8#ifndef OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
9#define OPENSUBDIV3_OSD_CPU_GL_VERTEX_BUFFER_H
11#include "../version.h"
16namespace OPENSUBDIV_VERSION {
31 using ID =
unsigned int;
35 void *deviceContext = NULL);
42 void UpdateData(
const float *src,
int startVertex,
int numVertices,
43 void *deviceContext = NULL);
77using namespace OPENSUBDIV_VERSION;
Concrete vertex buffer class for cpu subdivision and OpenGL drawing.
CpuGLVertexBuffer(int numElements, int numVertices)
Constructor.
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
static CpuGLVertexBuffer * Create(int numElements, int numVertices, void *deviceContext=NULL)
Creator. Returns NULL if error.
ID BindVBO(void *deviceContext=NULL)
bool allocate()
Allocates VBO for this buffer. Returns true if success.
~CpuGLVertexBuffer()
Destructor.