mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 03:12:36 +01:00
4fd92a1549
Also move up source files into the root directory, as there's nothing else in this directory
21 lines
493 B
C++
21 lines
493 B
C++
#include "gl/GeometryBuffer.hpp"
|
|
|
|
GeometryBuffer::GeometryBuffer() : vbo(0), num(0) {
|
|
}
|
|
|
|
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);
|
|
}
|