fix(vbo.cpp): add core namespace to functions

This commit is contained in:
2026-01-07 13:50:49 +01:00
parent ea5aed80d2
commit bf782efa85

View File

@@ -2,7 +2,7 @@
#include <cstddef> #include <cstddef>
VBO::VBO(const void *data, std::size_t size) core::VBO::VBO(const void *data, std::size_t size)
{ {
// Generate a unique OpenGL buffer handle (ID). // Generate a unique OpenGL buffer handle (ID).
glGenBuffers(1, &id); glGenBuffers(1, &id);
@@ -12,20 +12,20 @@ VBO::VBO(const void *data, std::size_t size)
glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW); glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);
} }
VBO::~VBO() core::VBO::~VBO()
{ {
// delete the OpenGL buffer handle // delete the OpenGL buffer handle
glDeleteBuffers(1, &this->id); glDeleteBuffers(1, &this->id);
} }
void VBO::bind() void core::VBO::bind()
{ {
// Bind this buffer to the GL_ARRAY_BUFFER target. // Bind this buffer to the GL_ARRAY_BUFFER target.
// GL_ARRAY_BUFFER tells opengl this buffer contains vertices // GL_ARRAY_BUFFER tells opengl this buffer contains vertices
glBindBuffer(GL_ARRAY_BUFFER, this->id); glBindBuffer(GL_ARRAY_BUFFER, this->id);
} }
void VBO::unbind() void core::VBO::unbind()
{ {
// bind the buffer to NULL handle (remove old id) // bind the buffer to NULL handle (remove old id)
glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0);