Eulerian Smoke Simulation on the GPU
VertexArrayObject Class Reference

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]_attribNamethe attribute's name
[in]_indexthe index of the generic vertex attribute to be modified
[in]_numComponentsspecifies the number of components per attribute (must be 1, 2, 3, or 4)
[in]_dataTypethe data type of each component
[in]_dataSizethe data size in bytes
[in]_datathe data to load
[in]_byteStridethe byte stride from one attribute to the next
[in]_bufferUsagethe expected usage pattern of the data store
[in]_bufferTargetthe target to bind the data buffer to
[in]_normalizedindicates 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]_primTypethe type of primitive to render
[in]_startIndexthe starting index in the enabled arrays
[in]_countthe 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]_primTypethe type of primitive to render
[in]_countthe number of indices to be rendered
[in]_indexDataTypethe data type of the vertex indices
[in]_indicesthe 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]_primTypethe type of primitive to render
[in]_startthe minimum array index contained in indices
[in]_endthe maximum array index contained in indices
[in]_countthe number of indices to be rendered
[in]_typethe data type of the vertex indices
[in]_indicesthe vertex indices data
GLuint VertexArrayObject::getVertexAttributeBufferHandle ( const char *  _attribName)

Accesor for a vertex attribute buffer handle.

Parameters:
[in]_attribNamethe attribute name
int VertexArrayObject::getVertexAttributeIndex ( const char *  _attribName)

Accesor for a vertex attribute index.

Parameters:
[in]_attribNamethe attribute name
bool VertexArrayObject::removeVertexAttribute ( const char *  _attribName)

Removes a vertex attribute from the VAO.

Parameters:
[in]_attribNamethe attribute's name

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables