A class for creating OpenGL Vertex Array Objects.
More...
#include <VertexArrayObject.h>
List of all members.
Public Member Functions |
| VertexArrayObject () |
| Constructor.
|
| ~VertexArrayObject () |
| Destructor.
|
GLuint | getHandle () const |
| Accessor for the VAO's handle.
|
void | bind () |
| Binds the VAO.
|
void | unbind () |
| Unbind the VAO.
|
bool | isBound () const |
| Returns if the VAO is bound.
|
bool | isAllocated () const |
| Returns if the VAO has allocated data.
|
bool | addVertexAttribute (const char *_attribName, GLuint _index, GLint _numComponents, GLenum _dataType, GLsizeiptr _dataSize, const GLvoid *_data, GLsizei _byteStride=0, GLenum _bufferUsage=GL_STATIC_DRAW, GLenum _bufferTarget=GL_ARRAY_BUFFER, GLboolean _normalized=GL_FALSE) |
| Adds a buffer and sets a vertex attribute to the VAO.
|
bool | removeVertexAttribute (const char *_attribName) |
| Removes a vertex attribute from the VAO.
|
int | getVertexAttributeIndex (const char *_attribName) |
| Accesor for a vertex attribute index.
|
GLuint | getVertexAttributeBufferHandle (const char *_attribName) |
| Accesor for a vertex attribute buffer handle.
|
bool | draw (GLenum _primType, GLsizei _count, GLint _startIndex=0) |
| Draws the VAO data.
|
bool | drawIndexed (GLenum _primType, GLsizei _count, GLenum _indexDataType, const GLvoid *_indices) |
| Draws the VAO data using vertex indices.
|
bool | drawIndexedRange (GLenum _primType, GLuint _start, GLuint _end, GLsizei _count, GLenum _indexDataType, const GLvoid *_indices) |
| Draws the VAO data using a range of vertex indices.
|
Detailed Description
A class for creating OpenGL Vertex Array Objects.
- Author:
- Nikolaos Verigakis
- Version:
- 1.0
- Date:
- 26/07/11 Revision History : Initial Version 26/07/11
Member Function Documentation
bool VertexArrayObject::addVertexAttribute |
( |
const char * |
_attribName, |
|
|
GLuint |
_index, |
|
|
GLint |
_numComponents, |
|
|
GLenum |
_dataType, |
|
|
GLsizeiptr |
_dataSize, |
|
|
const GLvoid * |
_data, |
|
|
GLsizei |
_byteStride = 0 , |
|
|
GLenum |
_bufferUsage = GL_STATIC_DRAW , |
|
|
GLenum |
_bufferTarget = GL_ARRAY_BUFFER , |
|
|
GLboolean |
_normalized = GL_FALSE |
|
) |
| |
Adds a buffer and sets a vertex attribute to the VAO.
- Parameters:
-
[in] | _attribName | the attribute's name |
[in] | _index | the index of the generic vertex attribute to be modified |
[in] | _numComponents | specifies the number of components per attribute (must be 1, 2, 3, or 4) |
[in] | _dataType | the data type of each component |
[in] | _dataSize | the data size in bytes |
[in] | _data | the data to load |
[in] | _byteStride | the byte stride from one attribute to the next |
[in] | _bufferUsage | the expected usage pattern of the data store |
[in] | _bufferTarget | the target to bind the data buffer to |
[in] | _normalized | indicates that values stored in an integer format are to be mapped to the range [-1,1] (for signed values) or [0,1] (for unsigned values) when they are accessed and converted to floating point |
bool VertexArrayObject::draw |
( |
GLenum |
_primType, |
|
|
GLsizei |
_count, |
|
|
GLint |
_startIndex = 0 |
|
) |
| |
Draws the VAO data.
- Parameters:
-
[in] | _primType | the type of primitive to render |
[in] | _startIndex | the starting index in the enabled arrays |
[in] | _count | the number of indices to be rendered |
bool VertexArrayObject::drawIndexed |
( |
GLenum |
_primType, |
|
|
GLsizei |
_count, |
|
|
GLenum |
_indexDataType, |
|
|
const GLvoid * |
_indices |
|
) |
| |
Draws the VAO data using vertex indices.
- Parameters:
-
[in] | _primType | the type of primitive to render |
[in] | _count | the number of indices to be rendered |
[in] | _indexDataType | the data type of the vertex indices |
[in] | _indices | the vertex indices data |
bool VertexArrayObject::drawIndexedRange |
( |
GLenum |
_primType, |
|
|
GLuint |
_start, |
|
|
GLuint |
_end, |
|
|
GLsizei |
_count, |
|
|
GLenum |
_indexDataType, |
|
|
const GLvoid * |
_indices |
|
) |
| |
Draws the VAO data using a range of vertex indices.
- Parameters:
-
[in] | _primType | the type of primitive to render |
[in] | _start | the minimum array index contained in indices |
[in] | _end | the maximum array index contained in indices |
[in] | _count | the number of indices to be rendered |
[in] | _type | the data type of the vertex indices |
[in] | _indices | the vertex indices data |
GLuint VertexArrayObject::getVertexAttributeBufferHandle |
( |
const char * |
_attribName | ) |
|
Accesor for a vertex attribute buffer handle.
- Parameters:
-
[in] | _attribName | the attribute name |
int VertexArrayObject::getVertexAttributeIndex |
( |
const char * |
_attribName | ) |
|
Accesor for a vertex attribute index.
- Parameters:
-
[in] | _attribName | the attribute name |
bool VertexArrayObject::removeVertexAttribute |
( |
const char * |
_attribName | ) |
|
Removes a vertex attribute from the VAO.
- Parameters:
-
[in] | _attribName | the attribute's name |
The documentation for this class was generated from the following files: