Implement spritebatch properly.

This commit is contained in:
2026-03-22 09:13:42 -05:00
parent 66ebcb1608
commit ca0e9fc3b2
19 changed files with 205 additions and 142 deletions

View File

@@ -18,9 +18,10 @@ typedef enum {
typedef struct {
int32_t vertexCount;
meshprimitivetypegl_t primitiveType;
const meshvertex_t *vertices;
#ifdef DUSK_OPENGL_LEGACY
const meshvertex_t *vertices;
// Nothing needed
#else
GLuint vaoId;
GLuint vboId;
@@ -43,6 +44,20 @@ errorret_t meshInitGL(
const meshvertex_t *vertices
);
/**
* Flushes the vertices (stored in memory) to the GPU.
*
* @param mesh Mesh to flush vertices for.
* @param vertOffset First vertice index to flush.
* @param vertCount Count of vertices to flush.
* @return Error state.
*/
errorret_t meshFlushGL(
meshgl_t *mesh,
const int32_t vertOffset,
const int32_t vertCount
);
/**
* Draws a mesh using OpenGL.
*