#include "vao.h"

/* Initializes a Vertex Array Object (VAO). */
void
vao_init(VAO* self)
{
	glGenVertexArrays(1, &self->handle);
}

/* Binds VAO. */
void
vao_bind(VAO* self)
{
	glBindVertexArray(self->handle);
}

/* Unbinds VAO. */
void
vao_unbind(void)
{
	glBindVertexArray(0);
}

/* Frees VAO. */
void
vao_free(VAO* self)
{
	glDeleteVertexArrays(1, &self->handle);
	memset(self, '\0', sizeof(VAO));
}
