VertexBuffer is an abstraction of low level openGL Vertex Buffer Object.
More...
#include <CCVertexIndexBuffer.h>
VertexBuffer is an abstraction of low level openGL Vertex Buffer Object.
It is used to save an array of vertices.
static VertexBuffer* create |
( |
int |
sizePerVertex, |
|
|
int |
vertexNumber, |
|
|
GLenum |
usage = GL_STATIC_DRAW |
|
) |
| |
|
static |
Create an instance of VertexBuffer.
- Parameters
-
sizePerVertex | Size in bytes of one vertex. |
vertexNumber | The number of vertex. |
usage | A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it. |
local create |
( |
local |
sizePerVertex, |
|
|
local |
vertexNumber, |
|
|
local |
usage = GL_STATIC_DRAW |
|
) |
| |
|
static |
Create an instance of VertexBuffer.
- Parameters
-
sizePerVertex | Size in bytes of one vertex. |
vertexNumber | The number of vertex. |
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 getSizePerVertex |
( |
| ) |
const |
Get the size in bytes of one vertex.
local getSizePerVertex |
( |
| ) |
|
Get the size in bytes of one vertex.
Get the internal openGL handle.
Get the internal openGL handle.
int getVertexNumber |
( |
| ) |
const |
Get the number of vertices.
local getVertexNumber |
( |
| ) |
|
Get the number of vertices.
bool init |
( |
int |
sizePerVertex, |
|
|
int |
vertexNumber, |
|
|
GLenum |
usage = GL_STATIC_DRAW |
|
) |
| |
|
protected |
Init the storage of vertex buffer.
- Parameters
-
sizePerVertex | Size in bytes of one vertex. |
vertexNumber | The number of vertex. |
usage | A hint to indicate whether the vertexBuffer are updated frequently or not to let GL optimise it. |
local init |
( |
local |
sizePerVertex, |
|
|
local |
vertexNumber, |
|
|
local |
usage = GL_STATIC_DRAW |
|
) |
| |
|
protected |
Init the storage of vertex buffer.
- Parameters
-
sizePerVertex | Size in bytes of one vertex. |
vertexNumber | The number of vertex. |
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 updateVertices |
( |
const void * |
verts, |
|
|
int |
count, |
|
|
int |
begin |
|
) |
| |
Update all or part of vertice data, if the range specified exceeds the vertex buffer, it will be clipped.
- Parameters
-
verts | The pointer of the vertex data. |
count | The number of vertices to update. |
begin | The first vertex to update. |
local updateVertices |
( |
local |
verts, |
|
|
local |
count, |
|
|
local |
begin |
|
) |
| |
Update all or part of vertice data, if the range specified exceeds the vertex buffer, it will be clipped.
- Parameters
-
verts | The pointer of the vertex data. |
count | The number of vertices to update. |
begin | The first vertex 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.
Size in bytes for one vertex.
Size in bytes for one vertex.
Hint for optimisation in GL.
Hint for optimisation in GL.
Internal handle for openGL.
Internal handle for openGL.
The documentation for this class was generated from the following file: