1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

OpenGL: encapsulate VBOs into a class

internal only for now but this will be handy
This commit is contained in:
sfan5 2024-12-08 18:02:45 +01:00
parent b087e2554f
commit bb550158fc
6 changed files with 147 additions and 58 deletions

View file

@ -8,6 +8,7 @@
#include "SIrrCreationParameters.h"
#include "Common.h"
#include "VBO.h"
#include "CNullDriver.h"
#include "IMaterialRendererServices.h"
#include "EDriverFeatures.h"
@ -49,8 +50,7 @@ public:
SHWBufferLink_opengl(const scene::IVertexBuffer *vb) : SHWBufferLink(vb) {}
SHWBufferLink_opengl(const scene::IIndexBuffer *ib) : SHWBufferLink(ib) {}
GLuint vbo_ID = 0;
u32 vbo_Size = 0;
OpenGLVBO Vbo;
};
bool updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer);
@ -300,7 +300,7 @@ protected:
LockRenderStateMode = false;
}
bool updateHardwareBuffer(SHWBufferLink_opengl *b, const void *buffer, size_t bufferSize, scene::E_HARDWARE_MAPPING hint);
bool uploadHardwareBuffer(OpenGLVBO &vbo, const void *buffer, size_t bufferSize, scene::E_HARDWARE_MAPPING hint);
void createMaterialRenderers();
@ -372,9 +372,8 @@ private:
bool EnableErrorTest;
unsigned QuadIndexCount;
GLuint QuadIndexBuffer = 0;
void initQuadsIndices(int max_vertex_count = 65536);
OpenGLVBO QuadIndexVBO;
void initQuadsIndices(u32 max_vertex_count = 65536);
void debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message);
static void APIENTRY debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);