![]() |
AireEngine
A 3D Open-World Game Engine
|
#include <vao.h>
Public Member Functions | |
| VertexArrayObject () | |
| Create a new VAO. | |
| void | bindVAO () |
| Bind the VAO for rendering. | |
| void | unbindVAO () |
| Unbind the VAO. | |
| void | addAttribF (GLuint attribIdx, GLint size, GLenum type, GLuint relativeOffset, GLboolean normalized=GL_FALSE, bool enabled=true, bool autoBind=true) |
| void | addAttribI (GLuint attribIdx, GLint size, GLenum type, GLuint relativeOffset, bool enabled=true, bool autoBind=true) |
| void | addAttribL (GLuint attribIdx, GLint size, GLuint relativeOffset, bool enabled=true, bool autoBind=true) |
| void | bindAttrib (GLuint attribIdx, GLuint bindingPointIdx) |
| void | enableAttrib (GLuint attribIdx) |
| void | disableAttrib (GLuint attribIdx) |
| GLuint | getHandle () const |
| VertexArrayObject (const VertexArrayObject &)=delete | |
| VertexArrayObject & | operator= (const VertexArrayObject &)=delete |
A wrapper over an OpenGL VAO. Used to simplify VAO setup and to provide automatic clean-up.
Bind an attribute to a given binding point. Vertex buffers can then be bound to this binding point. For convenience, it is advisable to always set the binding point to be the same as the attribute index.
| attribIdx | The attribute index to be bound. Corresponds to the index set in the shader with location specifier. |
| bindingPointIdx | An arbitrarily chosen index that will be associated with the attribute. VBO then needs to bind to the same index. |
Disable a given attribute.
| attribIdx | Attribute index of the attribute to disable. |
Enable a given attribute.
| attribIdx | Attribute index of the attribute to enable. |