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"
34namespace 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);
93using namespace OPENSUBDIV_VERSION;
Concrete vertex buffer class for cpu subdivision and OpenGL drawing.
CpuGLVertexBuffer(int numElements, int numVertices)
Constructor.
GLuint BindVBO(void *deviceContext=NULL)
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.
bool allocate()
Allocates VBO for this buffer. Returns true if success.
~CpuGLVertexBuffer()
Destructor.