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...
|
Handle< NCollection_Buffer > | myData |
| buffer data More...
|
|
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! More...
|
|
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). More...
|
|
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. More...
|
|
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. More...
|
|
template<class BaseBufferT>
class OpenGl_BufferCompatT< BaseBufferT >
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.