Shaders adapted for Legacy GL
Build Dusk / run-tests (pull_request) Failing after 24s
Build Dusk / build-linux (pull_request) Failing after 18s
Build Dusk / build-psp (pull_request) Failing after 18s
Build Dusk / build-gamecube (pull_request) Failing after 15s
Build Dusk / build-wii (pull_request) Failing after 16s

This commit is contained in:
2026-03-22 10:44:28 -05:00
parent ca0e9fc3b2
commit 5ac21db997
9 changed files with 184 additions and 61 deletions
+10
View File
@@ -8,6 +8,7 @@
#include "display/mesh/mesh.h"
#include "assert/assertgl.h"
#include "error/errorgl.h"
#include "display/shader/shadergl.h"
errorret_t meshInitGL(
meshgl_t *mesh,
@@ -25,6 +26,10 @@ errorret_t meshInitGL(
#ifdef DUSK_OPENGL_LEGACY
// Nothing needed.
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
errorChain(errorGLCheck());
#else
// Generate Vertex Buffer Object
glGenBuffers(1, &mesh->vboId);
@@ -143,6 +148,11 @@ errorret_t meshDrawGL(
(const GLvoid*)&mesh->vertices[offset].pos
);
// Shader may have model matrix here
#ifdef DUSK_OPENGL_LEGACY
errorChain(shaderLegacyMatrixUpdate());
#endif
glDrawArrays(mesh->primitiveType, offset, count);
errorChain(errorGLCheck());
#else