13 VertexArray* VertexArray::current =
nullptr;
16 glGenVertexArrays(1, &handle);
20 glDeleteVertexArrays(1, &handle);
23 if (VertexArray::current ==
this) {
24 VertexArray::current =
nullptr;
34 if (VertexArray::current ==
this) {
39 glBindVertexArray(handle);
40 VertexArray::current =
this;
44 glEnableVertexAttribArray(index);
48 glDisableVertexAttribArray(index);
52 void* pointer = (
void*) (
long(NULL) + offset);
53 glVertexAttribPointer(index, size,
to_GLenum(type), normalized, stride, pointer);
void disableAttribute(unsigned int index)
Disables a vertex attribute.
void bind()
Binds the vertex array object.
GLenum to_GLenum(E e)
Gets the GLenum value from an enum class.
void pointAttribute(unsigned int index, int size, ValueType type, bool normalized, int stride, long offset)
Sets the vertex attribute pointer.
Generic namespace for the SimpleGL framework.
ValueType
This enum wraps the vertex array object's value types.
GLuint getHandle()
Returns the handle of the vertex array object.
void enableAttribute(unsigned int index)
Enables a vertex attribute.
~VertexArray(void)
Deletes the vertex array object.
VertexArray(void)
Generates a new vertex array object.