src/scene.c

changeset 44
b3da4096c607
parent 43
5a8c31904e44
child 45
18de2af03531
--- a/src/scene.c	Thu Mar 21 23:01:09 2024 +0100
+++ b/src/scene.c	Tue Mar 26 20:37:21 2024 +0100
@@ -159,6 +159,7 @@
     // -----------------------------------------
     // process the render groups for each camera
     // -----------------------------------------
+    AscShaderProgram *shader;
     cx_for_n(cam_id, ASC_SCENE_CAMERAS_MAX) {
         // update camera parameters, first
         AscCamera *camera = &scene->cameras[cam_id];
@@ -173,8 +174,9 @@
         // Sprites
         // -------
         // TODO: see if we can really always ignore the view matrix
-        glUseProgram(ASC_SHADER_SPRITE.base.id);
-        glUniformMatrix4fv(ASC_SHADER_SPRITE.base.projection, 1,
+        shader = &asc_context.active_window->glctx.shader.sprite;
+        glUseProgram(shader->id);
+        glUniformMatrix4fv(shader->projection, 1,
                            GL_FALSE, camera->projection);
 
         // render opaque sprites from front to back

mercurial