6#include <brenta/logger.hpp>
7#include <brenta/vao.hpp>
9using namespace brenta::types;
22 glGenVertexArrays(1, &this->vao_id);
23 DEBUG(
"vao: initialized");
28 if (this->get_id() == 0)
return;
30 glDeleteVertexArrays(1, &this->vao_id);
31 DEBUG(
"vao: destroyed");
36 if (this->get_id() == 0)
38 ERROR(
"vao::bind: not initialized");
41 glBindVertexArray(this->get_id());
44void vao::unbind()
const
49unsigned int vao::get_id()
const
57 GLenum type, GLboolean normalized, GLsizei stride,
62 glVertexAttribPointer(index, size, type, normalized, stride, pointer);
63 glEnableVertexAttribArray(index);
Buffer wrapper around OpenGL buffer objects.
vao()
Default constructor, does nothing.
void set_vertex_data(buffer &buffer, unsigned int index, GLint size, GLenum type, GLboolean is_normalized, GLsizei stride, const void *pointer)
Set the vertex data.