* fixed compiling & added stuff

This commit is contained in:
end 2016-09-25 22:24:04 +02:00
parent d24d5357b8
commit c482a3f779
6 changed files with 381 additions and 11 deletions

View file

@ -1,6 +1,6 @@
#include <include/glclasses.h>
#define TBufferObject_(pre, post) template <GLenum T> pre BufferObject<T>::post
#define TBufferObject_(pre, post) template <GLenum T> pre endofthejedi::BufferObject<T>::post
#define TBufferObject(...) TBufferObject_(__VA_ARGS__)
TBufferObject(, BufferObject)() {
@ -35,4 +35,19 @@ TBufferObject(void, unmap)() {
//todo
}
endofthejedi::VAO::VAO() {
glGenVertexArrays(1, &m_name);
}
endofthejedi::VAO::~VAO() {
glDeleteVertexArrays(1, &m_name);
}
void endofthejedi::VAO::bind() {
glBindVertexArray(m_name);
}
void endofthejedi::VAO::fill(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer) {
glEnableVertexAttribArray(index);
glVertexAttribPointer(index, size, GL_FLOAT, normalized, stride, pointer);
}