31 lines
451 B
C++
31 lines
451 B
C++
|
|
#include "VAO.h"
|
|
|
|
VAO::VAO()
|
|
{
|
|
}
|
|
|
|
void VAO::LinkVBO(VBO& vbo, GLuint layout, GLuint numComponents, GLenum type, GLsizeiptr stride, void* offset) {
|
|
vbo.Bind();
|
|
|
|
glEnableVertexAttribArray(layout);
|
|
glVertexAttribPointer(layout, numComponents, type, GL_FALSE, stride, offset);
|
|
|
|
vbo.Unbind();
|
|
}
|
|
|
|
void VAO::Bind()
|
|
{
|
|
glBindVertexArray(ID);
|
|
}
|
|
|
|
void VAO::Unbind()
|
|
{
|
|
glBindVertexArray(0);
|
|
}
|
|
|
|
void VAO::Delete()
|
|
{
|
|
glDeleteVertexArrays(1, &ID);
|
|
ID = 0;
|
|
} |