A wrapper class for OpenGL's VAO, as well as its associated VBO and attributes. More...
#include <VAO.hpp>
Collaboration diagram for BARE2D::VAO:Public Member Functions | |
| VAO () | |
| ~VAO () | |
| void | init () |
| Initializes the necessary components, combining the VBO and VAO. More... | |
| void | destroy () |
| Releases necessary memory. More... | |
| void | bind () |
| Binds this vertex array object. More... | |
| void | bindVBO () |
| Binds the VAO's VBO. More... | |
| void | unbind () |
| Unbinds the vao. More... | |
| void | unbindVBO () |
| Unbinds this VAO's VBO. More... | |
| void | addVertexAttribute (GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *data) |
| Wrapper for glVertexAttribPointer - Adds an attribute to the VBO - each vertex data slot will gain some attribute. More... | |
Private Attributes | |
| unsigned int | m_numAttributes |
| GLuint | m_vaoHandle |
| GLuint | m_vboHandle |
A wrapper class for OpenGL's VAO, as well as its associated VBO and attributes.
| BARE2D::VAO::VAO | ( | ) |
Definition at line 5 of file VAO.cpp.
References m_numAttributes.
| void BARE2D::VAO::addVertexAttribute | ( | GLint | size, |
| GLenum | type, | ||
| GLboolean | normalized, | ||
| GLsizei | stride, | ||
| const void * | data | ||
| ) |
Wrapper for glVertexAttribPointer - Adds an attribute to the VBO - each vertex data slot will gain some attribute.
| size | Number of components per attribute (1-4) |
| type | Type of data - GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, etc. See docs |
| normalized | Should the data be normalized or converted directly? (GL_TRUE/GL_FALSE) |
| stride | Specifies the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in the array. The initial value is 0. |
| data | Specifies a offset of the first component of the first generic vertex attribute in the array in the data store of the buffer currently bound to the GL_ARRAY_BUFFER target. The initial value is 0. |
Definition at line 66 of file VAO.cpp.
References bind(), bindVBO(), m_numAttributes, and unbind().
Referenced by BARE2D::BasicRenderer::init(), BARE2D::FBORenderer::init(), BARE2D::TexturelessRenderer::init(), and BARE2D::DebugRenderer::init().
Here is the call graph for this function:
Here is the caller graph for this function:| void BARE2D::VAO::bind | ( | ) |
Binds this vertex array object.
Definition at line 48 of file VAO.cpp.
References m_vaoHandle.
Referenced by addVertexAttribute(), init(), BARE2D::BumpyRenderer::render(), BARE2D::FBORenderer::render(), BARE2D::Renderer::render(), and BARE2D::DebugRenderer::render().
Here is the caller graph for this function:| void BARE2D::VAO::bindVBO | ( | ) |
Binds the VAO's VBO.
Definition at line 57 of file VAO.cpp.
References m_vboHandle.
Referenced by addVertexAttribute(), BARE2D::BumpyRenderer::createRenderBatches(), BARE2D::BasicRenderer::createRenderBatches(), BARE2D::FBORenderer::createRenderBatches(), BARE2D::TexturelessRenderer::createRenderBatches(), and BARE2D::DebugRenderer::createRenderBatches().
Here is the caller graph for this function:| void BARE2D::VAO::destroy | ( | ) |
Releases necessary memory.
Definition at line 33 of file VAO.cpp.
References m_numAttributes, m_vaoHandle, m_vboHandle, and unbind().
Referenced by BARE2D::Renderer::destroy().
Here is the call graph for this function:
Here is the caller graph for this function:| void BARE2D::VAO::init | ( | ) |
Initializes the necessary components, combining the VBO and VAO.
Definition at line 14 of file VAO.cpp.
References bind(), m_vaoHandle, m_vboHandle, and unbind().
Referenced by BARE2D::Renderer::init().
Here is the call graph for this function:
Here is the caller graph for this function:| void BARE2D::VAO::unbind | ( | ) |
Unbinds the vao.
Definition at line 53 of file VAO.cpp.
Referenced by addVertexAttribute(), destroy(), init(), BARE2D::BumpyRenderer::render(), BARE2D::FBORenderer::render(), BARE2D::Renderer::render(), and BARE2D::DebugRenderer::render().
Here is the caller graph for this function:| void BARE2D::VAO::unbindVBO | ( | ) |
Unbinds this VAO's VBO.
Definition at line 62 of file VAO.cpp.
Referenced by BARE2D::BumpyRenderer::createRenderBatches(), BARE2D::BasicRenderer::createRenderBatches(), BARE2D::FBORenderer::createRenderBatches(), and BARE2D::TexturelessRenderer::createRenderBatches().
Here is the caller graph for this function:
|
private |
Definition at line 58 of file VAO.hpp.
Referenced by addVertexAttribute(), destroy(), and VAO().
|
private |
|
private |