Adding textures capabilities
* Added Texures to the two sample cubes * Modified mesh structure - mesh now contains indices and vertices - Vertices contain vertices and uv's (later on they will also contain normals) Solution definitely not perfect and needs improvement.
This commit is contained in:
@ -1,25 +1,25 @@
|
||||
#include "Graphics/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);
|
||||
}
|
||||
|
||||
#include "Graphics/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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user