Open CASCADE Technology 7.8.2.dev
|
Compatibility layer for old OpenGL without VBO. Make sure to pass pointer from GetDataOffset() instead of NULL. Method GetDataOffset() returns pointer to real data in this class (while base class OpenGl_VertexBuffer always return NULL). More...
#include <OpenGl_BufferCompatT.hxx>
Public Member Functions | |
OpenGl_BufferCompatT () | |
Create uninitialized VBO. | |
virtual | ~OpenGl_BufferCompatT () |
Destroy object. | |
virtual bool | IsVirtual () const override |
Return TRUE. | |
bool | Create (const Handle< OpenGl_Context > &theGlCtx) override |
Creates VBO name (id) if not yet generated. Data should be initialized by another method. | |
virtual void | Release (OpenGl_Context *theGlCtx) override |
Destroy object - will release memory if any. | |
virtual void | Bind (const Handle< OpenGl_Context > &) const override |
Bind this VBO. | |
virtual void | Unbind (const Handle< OpenGl_Context > &) const override |
Unbind this VBO. | |
advanced methods | |
Handle< NCollection_Buffer > | myData |
buffer data | |
bool | initLink (const Handle< NCollection_Buffer > &theData, const unsigned int theComponentsNb, const Standard_Integer theElemsNb, const unsigned int theDataType) |
Initialize buffer with existing data. Data will NOT be copied by this method! | |
virtual bool | init (const Handle< OpenGl_Context > &theGlCtx, const unsigned int theComponentsNb, const Standard_Integer theElemsNb, const void *theData, const unsigned int theDataType, const Standard_Integer theStride) override |
Initialize buffer with new data (data will be copied). | |
virtual bool | subData (const Handle< OpenGl_Context > &theGlCtx, const Standard_Integer theElemFrom, const Standard_Integer theElemsNb, const void *theData, const unsigned int theDataType) override |
Update part of the buffer with new data. | |
virtual bool | getSubData (const Handle< OpenGl_Context > &theGlCtx, const Standard_Integer theElemFrom, const Standard_Integer theElemsNb, void *theData, const unsigned int theDataType) override |
Read back buffer sub-range. | |
Compatibility layer for old OpenGL without VBO. Make sure to pass pointer from GetDataOffset() instead of NULL. Method GetDataOffset() returns pointer to real data in this class (while base class OpenGl_VertexBuffer always return NULL).
Methods Bind()/Unbind() do nothing (do not affect OpenGL state) and ::GetTarget() is never used. For this reason there is no analog for OpenGl_IndexBuffer. Just pass GetDataOffset() to glDrawElements() directly as last argument.
Class overrides methods init() and subData() to copy data into own memory buffer. Extra method initLink() might be used to pass existing buffer through handle without copying the data.
Method Create() creates dummy identifier for this object which should NOT be passed to OpenGL functions.
|
inline |
Create uninitialized VBO.
|
inlinevirtual |
Destroy object.
|
inlineoverridevirtual |
Bind this VBO.
|
inlineoverride |
Creates VBO name (id) if not yet generated. Data should be initialized by another method.
|
inlineoverridevirtual |
Read back buffer sub-range.
|
inlineoverridevirtual |
Initialize buffer with new data (data will be copied).
|
inline |
Initialize buffer with existing data. Data will NOT be copied by this method!
|
inlineoverridevirtual |
Return TRUE.
|
inlineoverridevirtual |
Destroy object - will release memory if any.
|
inlineoverridevirtual |
Update part of the buffer with new data.
|
inlineoverridevirtual |
Unbind this VBO.
|
protected |
buffer data