Open CASCADE Technology
7.3.0
|
Auxiliary class to iteratively modify data of existing VBO. It provides iteration interface with delayed CPU->GPU memory transfer to avoid slow per-element data transfer. User should explicitly call Flush() method to ensure that all data is transferred to VBO. Temporary buffer on CPU side can be initialized with lesser capacity than VBO to allow re-usage of shared buffer with fixed size between VBOs. More...
#include <OpenGl_VertexBufferEditor.hxx>
Public Member Functions | |
OpenGl_VertexBufferEditor (const Standard_Integer theTmpBufferLength=0) | |
Creates empty editor theTmpBufferLength - temporary buffer length. More... | |
OpenGl_VertexBufferEditor (theVec_t *theTmpBuffer, const Standard_Integer theTmpBufferLength) | |
Creates empty editor theTmpBuffer - pointer to temporary buffer theTmpBufferLength - temporary buffer length. More... | |
Standard_Boolean | Init (const Handle< OpenGl_Context > &theGlCtx, const Handle< OpenGl_VertexBuffer > &theVbo) |
Initialize editor for specified VBO. theGlCtx - bound OpenGL context to edit VBO theVbo - VBO to edit. More... | |
theVec_t & | Value () |
Modify current element in VBO. More... | |
Standard_Boolean | Next () |
Move to the next position in VBO. More... | |
Standard_Boolean | Flush () |
Push current data from local buffer to VBO. More... | |
const Handle< OpenGl_VertexBuffer > & | GetVBO () const |
Auxiliary class to iteratively modify data of existing VBO. It provides iteration interface with delayed CPU->GPU memory transfer to avoid slow per-element data transfer. User should explicitly call Flush() method to ensure that all data is transferred to VBO. Temporary buffer on CPU side can be initialized with lesser capacity than VBO to allow re-usage of shared buffer with fixed size between VBOs.
You should use NCollection_Vec2/NCollection_Vec3/NCollection_Vec4 with appropriate length to instantiate this template and access elements in VBO.
Notice that this technique designed for VBO streaming scenarios (when VBO is modified from time to time). Also this class doesn't retrieve existing data from VBO - data transferred only in one direction! In case of static data this is preferred to upload it within one call during VBO initialization.
|
inline |
Creates empty editor theTmpBufferLength - temporary buffer length.
|
inline |
Creates empty editor theTmpBuffer - pointer to temporary buffer theTmpBufferLength - temporary buffer length.
|
inline |
Push current data from local buffer to VBO.
|
inline |
|
inline |
Initialize editor for specified VBO. theGlCtx - bound OpenGL context to edit VBO theVbo - VBO to edit.
|
inline |
Move to the next position in VBO.
|
inline |
Modify current element in VBO.