IndexBuffer is an abstraction of low level openGL Buffer Object.
More...
#include <CCVertexIndexBuffer.h>
IndexBuffer is an abstraction of low level openGL Buffer Object.
It used to save an array of indices.
Enum for the type of index, short indices and int indices could be used.
Enumerator |
---|
INDEX_TYPE_SHORT_16 |
Short index will be used.
|
INDEX_TYPE_UINT_32 |
Int index will be used.
|
Enum for the type of index, short indices and int indices could be used.
Enumerator |
---|
INDEX_TYPE_SHORT_16 |
Short index will be used.
|
INDEX_TYPE_UINT_32 |
Int index will be used.
|
Create an instance of IndexBuffer.
- Parameters
-
type | type of index. |
number | The number of indices. |
usage | A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it. |
local create |
( |
local |
type, |
|
|
local |
number, |
|
|
local |
usage = GL_STATIC_DRAW |
|
) |
| |
|
static |
Create an instance of IndexBuffer.
- Parameters
-
type | type of index. |
number | The number of indices. |
usage | A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it. |
static void enableShadowCopy |
( |
bool |
enabled | ) |
|
|
inlinestatic |
Static setter for shadowCopy.
local enableShadowCopy |
( |
local |
enabled | ) |
|
|
inlinestatic |
Static setter for shadowCopy.
int getIndexNumber |
( |
| ) |
const |
Get the number of indices.
Get the number of indices.
Get the size in bytes of the array of indices.
Get the size in bytes of the array of indices.
int getSizePerIndex |
( |
| ) |
const |
Get the size in bytes for one index, will be 2 for INDEX_TYPE_SHORT_16 and 4 for INDEX_TYPE_UINT_32.
local getSizePerIndex |
( |
| ) |
|
Get the size in bytes for one index, will be 2 for INDEX_TYPE_SHORT_16 and 4 for INDEX_TYPE_UINT_32.
Getter for type of indices.
Getter for type of indices.
Get the openGL handle for index buffer.
Get the openGL handle for index buffer.
bool init |
( |
IndexType |
type, |
|
|
int |
number, |
|
|
GLenum |
usage = GL_STATIC_DRAW |
|
) |
| |
|
protected |
Init the storageof IndexBuffer.
- Parameters
-
type | type of index. |
number | The number of indices. |
usage | A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it. |
local init |
( |
local |
type, |
|
|
local |
number, |
|
|
local |
usage = GL_STATIC_DRAW |
|
) |
| |
|
protected |
Init the storageof IndexBuffer.
- Parameters
-
type | type of index. |
number | The number of indices. |
usage | A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it. |
static bool isShadowCopyEnabled |
( |
| ) |
|
|
inlinestatic |
Static getter for shadowCopy.
local isShadowCopyEnabled |
( |
| ) |
|
|
inlinestatic |
Static getter for shadowCopy.
void recreateVBO |
( |
| ) |
const |
|
protected |
Event handler for foreground.
Event handler for foreground.
bool updateIndices |
( |
const void * |
indices, |
|
|
int |
count, |
|
|
int |
begin |
|
) |
| |
Update all or part of indices data, if the range specified exceeds the vertex buffer, it will be clipped.
- Parameters
-
indices | The pointer of the index data. |
count | The number of indices to update. |
begin | The start index to update. |
local updateIndices |
( |
local |
indices, |
|
|
local |
count, |
|
|
local |
begin |
|
) |
| |
Update all or part of indices data, if the range specified exceeds the vertex buffer, it will be clipped.
- Parameters
-
indices | The pointer of the index data. |
count | The number of indices to update. |
begin | The start index to update. |
Static member to indicate that use _shadowCopy or not.
Static member to indicate that use _shadowCopy or not.
Event listener for foreground.
local _recreateVBOEventListener |
|
protected |
Event listener for foreground.
std::vector<unsigned char>
_shadowCopy |
|
protected |
Buffer used for shadow copy.
Buffer used for shadow copy.
Hint for optimisation in GL.
Hint for optimisation in GL.
The documentation for this class was generated from the following file: