19#ifndef FENNEC_RENDERERS_OPENGL_LIB_VERTEX_ARRAY_H
20#define FENNEC_RENDERERS_OPENGL_LIB_VERTEX_ARRAY_H
22#include <fennec/renderers/opengl/lib/fwd.h>
23#include <fennec/renderers/opengl/lib/enum.h>
33 constexpr vertex_array()
35 glGenVertexArrays(1, &_handle);
38 constexpr ~vertex_array() {
39 glDeleteVertexArrays(1, &_handle);
42 constexpr void start()
const {
43 glBindVertexArray(_handle);
46 constexpr void end()
const {
47 glBindVertexArray(NULL);
50 constexpr void set_attribute(GLuint i, GLenum type, GLint n, GLintptr offset, GLboolean normalized =
false) {
51 glVertexAttribFormat(i, n, type, normalized, offset);
52 glEnableVertexAttribArray(i);
55 constexpr void clear_attribute(GLuint i) {
56 glDisableVertexAttribArray(i);