All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CpuGLVertexBuffer Class Reference

Concrete vertex buffer class for cpu subvision and OpenGL drawing. More...

#include <cpuGLVertexBuffer.h>

Public Member Functions

 ~CpuGLVertexBuffer ()
 Destructor. More...
 
void UpdateData (const float *src, int startVertex, int numVertices)
 
int GetNumElements () const
 Returns how many elements defined in this vertex buffer. More...
 
int GetNumVertices () const
 Returns how many vertices allocated in this vertex buffer. More...
 
float * BindCpuBuffer ()
 
GLuint BindVBO ()
 

Static Public Member Functions

static CpuGLVertexBufferCreate (int numElements, int numVertices)
 Creator. Returns NULL if error. More...
 

Protected Member Functions

 CpuGLVertexBuffer (int numElements, int numVertices)
 Constructor. More...
 
bool allocate ()
 Allocates VBO for this buffer. Returns true if success. More...
 

Detailed Description

Concrete vertex buffer class for cpu subvision and OpenGL drawing.

CpuGLVertexBuffer implements CpuVertexBufferInterface and GLVertexBufferInterface.

The buffer interop between Cpu and GL is handled automatically when a client calls BindCpuBuffer and BindVBO methods.

Definition at line 46 of file cpuGLVertexBuffer.h.

Constructor & Destructor Documentation

Destructor.

CpuGLVertexBuffer ( int  numElements,
int  numVertices 
)
protected

Constructor.

Member Function Documentation

bool allocate ( )
protected

Allocates VBO for this buffer. Returns true if success.

float* BindCpuBuffer ( )

Returns cpu memory. GL buffer will be mapped to cpu address if necessary.

GLuint BindVBO ( )

Returns the name of GL buffer object. If the buffer is mapped to cpu address, it will be unmapped back to GL.

static CpuGLVertexBuffer* Create ( int  numElements,
int  numVertices 
)
static

Creator. Returns NULL if error.

int GetNumElements ( ) const

Returns how many elements defined in this vertex buffer.

int GetNumVertices ( ) const

Returns how many vertices allocated in this vertex buffer.

void UpdateData ( const float *  src,
int  startVertex,
int  numVertices 
)

This method is meant to be used in client code in order to provide coarse vertices data to Osd.


The documentation for this class was generated from the following file: