25 #ifndef OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H 26 #define OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H 28 #include "../version.h" 31 #include "../osd/opengl.h" 34 namespace OPENSUBDIV_VERSION {
51 void *deviceContext = NULL);
58 void UpdateData(
const float *src,
int startVertex,
int numVertices,
59 void *deviceContext = NULL);
73 GLuint
BindVBO(
void *deviceContext = NULL);
93 using namespace OPENSUBDIV_VERSION;
97 #endif // OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H ~CpuGLVertexBuffer()
Destructor.
bool allocate()
Allocates VBO for this buffer. Returns true if success.
GLuint BindVBO(void *deviceContext=NULL)
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
Concrete vertex buffer class for cpu subdivision and OpenGL drawing.
static CpuGLVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
CpuGLVertexBuffer(int numElements, int numVertices)
Constructor.