Nigel Barink
9165e30d0e
* Using import library assimp to incorrectly load a cube.obj * Using a temporary Renderable class as a placeholder for all data needed to render the mesh. * Vertex Array abstraction added
26 lines
521 B
C++
26 lines
521 B
C++
#include <MyGraphicsEngine/VertexArray.h>
|
|
#include <glad/glad.h>
|
|
|
|
void VertexArray::Create(){
|
|
glGenVertexArrays(1, &id);
|
|
}
|
|
|
|
void VertexArray::Bind(){
|
|
glBindVertexArray(id);
|
|
}
|
|
|
|
void VertexArray::Unbind(){
|
|
glBindVertexArray(0);
|
|
}
|
|
|
|
void VertexArray::Delete() {
|
|
glDeleteVertexArrays(1, &id);
|
|
}
|
|
|
|
|
|
void VertexArray::AttachAttribute(unsigned int index , int size, int stride ){
|
|
glVertexAttribPointer(index, size, GL_FLOAT, GL_FALSE, stride, 0);
|
|
glEnableVertexAttribArray(0);
|
|
}
|
|
|