1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Handle vertex & index VBOs separately in GL drivers

This commit is contained in:
sfan5 2024-08-28 19:35:28 +02:00
parent be9aa19208
commit 6b7fc1e9fe
7 changed files with 346 additions and 283 deletions

View file

@ -31,6 +31,8 @@ class IWriteFile;
namespace scene
{
class IMeshBuffer;
class IVertexBuffer;
class IIndexBuffer;
class IMesh;
class IMeshManipulator;
class ISceneNode;
@ -299,7 +301,10 @@ public:
virtual void removeAllTextures() = 0;
//! Remove hardware buffer
virtual void removeHardwareBuffer(const scene::IMeshBuffer *mb) = 0;
virtual void removeHardwareBuffer(const scene::IVertexBuffer *vb) = 0;
//! Remove hardware buffer
virtual void removeHardwareBuffer(const scene::IIndexBuffer *ib) = 0;
//! Remove all hardware buffers
virtual void removeAllHardwareBuffers() = 0;
@ -738,6 +743,17 @@ public:
/** \param mb Buffer to draw */
virtual void drawMeshBuffer(const scene::IMeshBuffer *mb) = 0;
/**
* Draws a mesh from individual vertex and index buffers.
* @param vb vertices to use
* @param ib indices to use
* @param primCount amount of primitives
* @param pType primitive type
*/
virtual void drawBuffers(const scene::IVertexBuffer *vb,
const scene::IIndexBuffer *ib, u32 primCount,
scene::E_PRIMITIVE_TYPE pType = scene::EPT_TRIANGLES) = 0;
//! Draws normals of a mesh buffer
/** \param mb Buffer to draw the normals of
\param length length scale factor of the normals