initial import, >900commits predate this

This commit is contained in:
2020-09-29 13:47:50 +02:00
commit e74154ccee
352 changed files with 108120 additions and 0 deletions

View File

@ -0,0 +1,32 @@
//
// Created by FlaXxy on 21.05.2018.
//
#include "./buffer.hpp"
namespace MM::OpenGL {
Buffer::Buffer(const void* data, std::size_t size, GLenum usage) : _size(size) {
glGenBuffers(1, &_handle);
glBindBuffer(GL_ARRAY_BUFFER, _handle);
glBufferData(GL_ARRAY_BUFFER, size, data, usage);
}
Buffer::~Buffer(void) {
glDeleteBuffers(1,&_handle);
}
void Buffer::bind(GLenum target) const {
glBindBuffer(target, _handle);
}
void Buffer::unbind(GLenum target) const {
glBindBuffer(target, 0);
}
std::size_t Buffer::getSize(void) const {
return _size;
}
} // MM::OpenGL