#include #define TBufferObject_(pre, post) template pre endofthejedi::BufferObject::post #define TBufferObject(...) TBufferObject_(__VA_ARGS__) TBufferObject(, BufferObject)() { glGenBuffers(1, &m_name); } TBufferObject(, ~BufferObject)() { glDeleteBuffers(1, m_name); } TBufferObject(void, bind)() { glBindBuffer(T, m_name); } TBufferObject(void, bind)(GLuint index, GLintptr offset, GLsizeiptr size) { //todo } TBufferObject(void, fill)(GLenum usage, GLsizei size, GLvoid* data) { glBufferData(T, size, data, usage); } TBufferObject(void, subfill)(GLintptr offset, GLsizei size, const GLvoid* data) { glBufferSubData(T, offset, size, data); } TBufferObject(void, map)(GLenum access) { //todo } 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); }