|
cangine
|
Wraps an OpenGL Vertex Array Object. More...
#include <vao.hpp>
Public Member Functions | |
| VAO () | |
| Generates the underlying OpenGL vertex array object. | |
| ~VAO () | |
| Deletes the underlying OpenGL vertex array object. | |
| void | linkAttrib (const VBO &vbo, unsigned int layoutLocation, int count, int stride, uintptr_t offset) |
| Links a vertex attribute from a VBO into this VAO. | |
| void | bind () const |
| Binds this vertex array object. | |
| void | unbind () const |
| Unbinds the current vertex array object. | |
Private Attributes | |
| unsigned int | ID |
| OpenGL vertex array object handle. | |
Wraps an OpenGL Vertex Array Object.
Records the vertex attribute layout (which VBO feeds which shader input and how) so it can be rebound with a single call.
| cangine::VAO::VAO | ( | ) |
Generates the underlying OpenGL vertex array object.
| cangine::VAO::~VAO | ( | ) |
Deletes the underlying OpenGL vertex array object.
| void cangine::VAO::bind | ( | ) | const |
Binds this vertex array object.
| void cangine::VAO::linkAttrib | ( | const VBO & | vbo, |
| unsigned int | layoutLocation, | ||
| int | count, | ||
| int | stride, | ||
| uintptr_t | offset | ||
| ) |
Links a vertex attribute from a VBO into this VAO.
| vbo | Buffer supplying the attribute data. |
| layoutLocation | Shader attribute location index. |
| count | Number of components per attribute (e.g. 3 for a vec3). |
| stride | Byte offset between consecutive attributes. |
| offset | Byte offset of the first component within the vertex. |
| void cangine::VAO::unbind | ( | ) | const |
Unbinds the current vertex array object.
|
private |
OpenGL vertex array object handle.