Avogadro::Rendering::VertexArrayObject#

class VertexArrayObject#

Vertex Array Object to capture vertex attribute state.

<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();

Public Functions

VertexArrayObject()#
~VertexArrayObject()#
VertexArrayObject(const VertexArrayObject&) = delete#
VertexArrayObject &operator=(const VertexArrayObject&) = delete#
bool bind()#

Bind the VAO, making it active for attribute setup or rendering.

void release()#

Unbind the VAO.

inline Index handle() const#

Get the OpenGL handle. Returns 0 if not yet created.