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.
This commit is contained in:
Wisdometrics 2019-08-09 17:36:01 +02:00 committed by GitHub
parent 6f2f09947f
commit 654d3a29e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;