GL Studio C++ Runtime API
GlsIndexArray Class Reference
Inheritance diagram for GlsIndexArray:
NonCopyable

Public Member Functions

 GlsIndexArray ()
 
virtual ~GlsIndexArray ()
 
void SetSize (const unsigned int size)
 
unsigned int GetSize () const
 
void SetIndices (const unsigned short indexData[])
 
void SetIndex (const unsigned int index, const unsigned short value)
 
void Bake (IGlsStateManager *stateManager)
 
void Bind (IGlsStateManager *stateManager)
 

Protected Member Functions

void AllocateBuffer (const unsigned int size)
 
void DeallocateBuffer ()
 

Protected Attributes

unsigned short * _indexData
 
unsigned int _vboHandle
 
unsigned int _size
 

Constructor & Destructor Documentation

Default constructor

virtual ~GlsIndexArray ( )
virtual

Destructor

Member Function Documentation

void AllocateBuffer ( const unsigned int  size)
protected

Allocates the buffer data, copying the existing data

Parameters
sizeThe new size in bytes to allocate
void Bake ( IGlsStateManager stateManager)

Download the index buffer data to Open GL

Precondition
(_vboHandle != 0) && (_size > 0)
Parameters
stateManagerThe OpenGL state to download the index buffer to
void Bind ( IGlsStateManager stateManager)

Bind the index buffer, e.g. make it current

Precondition
(_vboHandle != 0) && (_size > 0)
Parameters
stateManagerThe OpenGL state to bind the buffer on
void DeallocateBuffer ( )
protected

Deallocates the buffer data

unsigned int GetSize ( ) const
inline
Returns
Returns the size of the index buffer
void SetIndex ( const unsigned int  index,
const unsigned short  value 
)

Sets one index

Precondition
index < _size
Parameters
indexThe index of the index to set
valThe index data
void SetIndices ( const unsigned short  indexData[])

Populates the the index buffer

Precondition
_size > 0
Parameters
indexDataThe indices to set. The array length is assumed to be equal to GetSize()
void SetSize ( const unsigned int  size)

Sets the size of the index buffer

Parameters
sizeNew index buffer count

Member Data Documentation

unsigned short* _indexData
protected

The memory for storing the indices

unsigned int _size
protected

The number of indices. There can be unsigned int quantity of unsigned short values

unsigned int _vboHandle
protected

The OpenGL VBO handle


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