|
| GlsVertexArray () |
|
virtual | ~GlsVertexArray () |
|
void | Setup (const int nVerts, const bool hasT, const bool hasC, const bool hasN) |
|
void | SetVertices (const Vertex verts[]) |
|
void | SetTexCoords (const Vector verts[]) |
|
void | SetNormals (const Vector verts[]) |
|
void | SetColors (const Vertex verts[]) |
|
void | SetVertex (const unsigned int index, const Vector &v) |
|
void | SetTexCoord (const unsigned int index, const Vector &v) |
|
void | Bake (IGlsStateManager *stateManager) |
|
void | Draw (const unsigned int glPrimitive, IGlsStateManager *stateManager, const bool texture, const bool color, const bool normal) |
|
void | Draw (const unsigned int glPrimitive, const unsigned int offset, const unsigned int count, GlsIndexArray &indexBuffer, IGlsStateManager *stateManager, const bool texture, const bool color, const bool normal) |
|
void | MultiDraw (const unsigned int glPrimitive, const unsigned int offset, const unsigned int count, const unsigned int primitiveSize, GlsIndexArray &indexBuffer, IGlsStateManager *stateManager, const bool texture, const bool color, const bool normal) |
|
|
static const GLuint | VERT_SIZE = sizeof( GL_FLOAT ) * 3 |
|
void AllocateBuffer |
( |
const unsigned int |
size | ) |
|
|
protected |
Allocates the buffer data, copying the existing data
- Parameters
-
size | The new size in bytes to allocate |
Bake the vertex buffer to a VBO
- Precondition
- _setup == true
- Parameters
-
stateManager | State manager for the OpenGL context to bake the VBO in |
void DeallocateBuffer |
( |
| ) |
|
|
protected |
Deallocates the buffer data
void Draw |
( |
const unsigned int |
glPrimitive, |
|
|
IGlsStateManager * |
stateManager, |
|
|
const bool |
texture, |
|
|
const bool |
color, |
|
|
const bool |
normal |
|
) |
| |
Draw this vertex array
- Precondition
- _setup == true
- Postcondition
- The VBO is drawn
- Parameters
-
glPrimitive | The OpenGL primitive type to draw (e.g. GL_LINE_LOOP) |
stateManager | State manager for the OpenGL context to draw in |
texture | Whether or not to draw with texture |
color | Whether or not to use per vertex colors |
normal | Whether or not to use per vertex normals |
void Draw |
( |
const unsigned int |
glPrimitive, |
|
|
const unsigned int |
offset, |
|
|
const unsigned int |
count, |
|
|
GlsIndexArray & |
indexBuffer, |
|
|
IGlsStateManager * |
stateManager, |
|
|
const bool |
texture, |
|
|
const bool |
color, |
|
|
const bool |
normal |
|
) |
| |
Draw this vertex array
- Precondition
- _setup == true
- Postcondition
- The VBO is drawn
- Parameters
-
glPrimitive | The OpenGL primitive type to draw (e.g. GL_LINE_LOOP) |
offset | Index of the first vertex to draw |
count | Number of primitives to draw |
indexBuffer | Index buffer to use |
stateManager | State manager for the OpenGL context to draw in |
texture | Whether or not to draw with texture |
color | Whether or not to use per vertex colors |
normal | Whether or not to use per vertex normals |
void MultiDraw |
( |
const unsigned int |
glPrimitive, |
|
|
const unsigned int |
offset, |
|
|
const unsigned int |
count, |
|
|
const unsigned int |
primitiveSize, |
|
|
GlsIndexArray & |
indexBuffer, |
|
|
IGlsStateManager * |
stateManager, |
|
|
const bool |
texture, |
|
|
const bool |
color, |
|
|
const bool |
normal |
|
) |
| |
Draw this vertex array
- Precondition
- _setup == true
- Postcondition
- The VBO is drawn
- Parameters
-
glPrimitive | The OpenGL primitive type to draw (e.g. GL_LINE_LOOP) |
offset | Index of the first vertex to draw |
count | Number of primitives to draw |
primitiveSize | Number of vertices per primitive |
indexBuffer | Index buffer to use |
stateManager | State manager for the OpenGL context to draw in |
texture | Whether or not to draw with texture |
color | Whether or not to use per vertex colors |
normal | Whether or not to use per vertex normals |
void SetColors |
( |
const Vertex |
verts[] | ) |
|
Sets the Colors of the array. Note: This takes an array of Vertex for compatibility with DisplayObject. It gets the colors from the color component of the vertices.
- Precondition
- (_setup && _hasC)
- Parameters
-
verts | An array of colors to populate this object with. verts[] must have at least _nVerts elements |
void SetNormals |
( |
const Vector |
verts[] | ) |
|
Sets the Normals of the array
- Precondition
- (_setup && _hasN)
- Parameters
-
verts | An array of normals to populate this object with. verts[] must have at least _nVerts elements |
void SetTexCoord |
( |
const unsigned int |
index, |
|
|
const Vector & |
v |
|
) |
| |
Sets a single texture coordinate
- Precondition
- _setup && (index < _nVerts) && _hasT
- Parameters
-
index | The index of the texture coordinate to set |
v | The texture coordinate to set |
void SetTexCoords |
( |
const Vector |
verts[] | ) |
|
Sets the texture coordinates of the array
- Precondition
- (_setup && _hasT)
- Parameters
-
verts | An array of texture coords to populate this object with. verts[] must have at least _nVerts elements |
void Setup |
( |
const int |
nVerts, |
|
|
const bool |
hasT, |
|
|
const bool |
hasC, |
|
|
const bool |
hasN |
|
) |
| |
Prepare the vertex buffer to be populated. Allocates vertex buffer, sets up component offsets.
- Parameters
-
nVerts | Number of vertices in the array |
hasT | True if array has texture coords |
hasC | True if array has colors |
hasN | True if array has normas |
void SetVertex |
( |
const unsigned int |
index, |
|
|
const Vector & |
v |
|
) |
| |
Sets a single vertex
- Precondition
- _setup && (index < _nVerts)
- Parameters
-
index | The index of the vertex to set |
v | The vertex to set |
void SetVertices |
( |
const Vertex |
verts[] | ) |
|
Sets the vertices of the array
- Precondition
- _setup == true
- Parameters
-
verts | An array of vertices to populate this object with. verts[] must have at least _nVerts elements |
Size of data pointed to by _vertexData
unsigned int _colorOffset |
|
protected |
Offset of the color from the beginning of a component, in bytes
unsigned int _componentSize |
|
protected |
Size of one element of this array (total size of all components) in bytes
True if this object has colors
True if this object has normals
True if this object has texture coordinates
unsigned int _normalOffset |
|
protected |
Offset of the normals from the beginning of a component, in bytes
Number of vertices in this object
True if this object has been setup and can be downloaded to a VBO
Offset of the texture coords from the beginning of a component, in bytes
unsigned char* _vertexData |
|
protected |
Contains the dynamically allocated, interleaved vertex data that gets sent to the VBO
const GLuint VERT_SIZE = sizeof( GL_FLOAT ) * 3 |
|
static |
Constant sizes of the primitive vertex attributes
The documentation for this class was generated from the following file: