From 654d3a29e2444982a29fcaa69ab582faa93b2519 Mon Sep 17 00:00:00 2001 From: Wisdometrics <48574646+Wisdometrics@users.noreply.github.com> Date: Fri, 9 Aug 2019 17:36:01 +0200 Subject: [PATCH] Added rlglDraw() to SetShaderValueV() Usually if you update shader values, they will only take effect when starting a new shader mode because that's when the draw function is called. By calling it when changing shader values, you ensure the changes take place instantly. This makes it way simpler to do palette swapping and other "dynamic" shader functions. --- src/rlgl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index aa0c5e144..fd3b993f8 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3092,7 +3092,9 @@ void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int unifo { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) glUseProgram(shader.id); - + + rlglDraw(); // Force draw + switch (uniformType) { case UNIFORM_FLOAT: glUniform1fv(uniformLoc, count, (float *)value); break;