1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00
openrw/rwcore/gl/GeometryBuffer.cpp

18 lines
438 B
C++
Raw Normal View History

#include "gl/GeometryBuffer.hpp"
2014-02-10 06:43:20 +01:00
2016-09-09 22:13:21 +02:00
GeometryBuffer::~GeometryBuffer() {
if (vbo != 0) {
glDeleteBuffers(1, &vbo);
}
2014-02-10 09:55:01 +01:00
}
2016-09-09 22:13:21 +02:00
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);
2014-02-10 06:43:20 +01:00
}