Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (15 sloc) 445 Bytes
#include "VertexBuffer.h"
VertexBuffer::VertexBuffer(const void* data, unsigned int size) {
glGenBuffers(1, &m_handle);
glBindBuffer(GL_ARRAY_BUFFER, m_handle);
glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);
}
VertexBuffer::~VertexBuffer() {
glDeleteBuffers(1, &m_handle);
}
void VertexBuffer::bind() const {
glBindBuffer(GL_ARRAY_BUFFER, m_handle);
}
void VertexBuffer::unbind() const {
glBindBuffer(GL_ARRAY_BUFFER, 0);
}