|
AvogadroLibs 1.103.0
|
Vertex Array Object to capture vertex attribute state. More...
#include <vertexarrayobject.h>
Public Member Functions | |
| VertexArrayObject (const VertexArrayObject &)=delete | |
| VertexArrayObject & | operator= (const VertexArrayObject &)=delete |
| bool | bind () |
| void | release () |
| Index | handle () const |
<avogadro/rendering/vertexarrayobject.h>
This class wraps an OpenGL VAO, which captures the state of vertex attribute bindings. Required for OpenGL 3.2+ core profile.
The VAO handle is lazily created on first bind(), allowing the object to be constructed before the OpenGL context is initialized.
Usage pattern: // During setup (when buffers change): vao.bind(); vbo.bind(); ibo.bind(); // set up vertex attribute pointers vao.release();
// During render: vao.bind(); glDrawElements(...); vao.release();
| bool bind | ( | ) |
Bind the VAO, making it active for attribute setup or rendering.
| void release | ( | ) |
Unbind the VAO.
| Index handle | ( | ) | const |
Get the OpenGL handle. Returns 0 if not yet created.