master #5

Merged
BRNSystems merged 45 commits from Mirrorlandia_minetest/irrlicht:master into master 2024-02-27 13:26:18 +01:00
Showing only changes of commit 45ace61007 - Show all commits

@ -486,10 +486,12 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
{ {
HWBuffer->vbo_verticesSize = bufferSize; HWBuffer->vbo_verticesSize = bufferSize;
if (HWBuffer->Mapped_Vertex == scene::EHM_STATIC) GLenum usage = GL_STATIC_DRAW;
GL.BufferData(GL_ARRAY_BUFFER, bufferSize, buffer, GL_STATIC_DRAW); if (HWBuffer->Mapped_Index == scene::EHM_STREAM)
else usage = GL_STREAM_DRAW;
GL.BufferData(GL_ARRAY_BUFFER, bufferSize, buffer, GL_DYNAMIC_DRAW); else if (HWBuffer->Mapped_Index == scene::EHM_DYNAMIC)
usage = GL_DYNAMIC_DRAW;
GL.BufferData(GL_ARRAY_BUFFER, bufferSize, buffer, usage);
} }
GL.BindBuffer(GL_ARRAY_BUFFER, 0); GL.BindBuffer(GL_ARRAY_BUFFER, 0);
@ -549,10 +551,12 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
{ {
HWBuffer->vbo_indicesSize = indexCount * indexSize; HWBuffer->vbo_indicesSize = indexCount * indexSize;
if (HWBuffer->Mapped_Index == scene::EHM_STATIC) GLenum usage = GL_STATIC_DRAW;
GL.BufferData(GL_ELEMENT_ARRAY_BUFFER, indexCount * indexSize, indices, GL_STATIC_DRAW); if (HWBuffer->Mapped_Index == scene::EHM_STREAM)
else usage = GL_STREAM_DRAW;
GL.BufferData(GL_ELEMENT_ARRAY_BUFFER, indexCount * indexSize, indices, GL_DYNAMIC_DRAW); else if (HWBuffer->Mapped_Index == scene::EHM_DYNAMIC)
usage = GL_DYNAMIC_DRAW;
GL.BufferData(GL_ELEMENT_ARRAY_BUFFER, indexCount * indexSize, indices, usage);
} }
GL.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); GL.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);