KlassischeKeplerKriege/KKK/game/src/glclasses.cpp

39 lines
790 B
C++
Raw Normal View History

2016-09-15 15:23:02 +00:00
#include <include/glclasses.h>
#define TBufferObject_(pre, post) template <GLenum T> pre BufferObject<T>::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
}