1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 20:02:40 +01:00
openrw/rwcore/gl/GeometryBuffer.cpp
2018-09-15 23:39:46 +02:00

18 lines
438 B
C++

#include "gl/GeometryBuffer.hpp"
GeometryBuffer::~GeometryBuffer() {
if (vbo != 0) {
glDeleteBuffers(1, &vbo);
}
}
void GeometryBuffer::uploadVertices(GLsizei num, GLsizeiptr size,
const GLvoid* mem) {
if (vbo == 0) {
glGenBuffers(1, &vbo);
}
this->num = num;
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, size, mem, GL_STATIC_DRAW);
}