summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 747025b8..6ad6394d 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -4135,7 +4135,14 @@ void rlSetUniformSampler(int locIndex, unsigned int textureId)
{
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
// Check if texture is already active
- for (int i = 0; i < RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS; i++) if (RLGL.State.activeTextureId[i] == textureId) return;
+ for (int i = 0; i < RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS; i++)
+ {
+ if (RLGL.State.activeTextureId[i] == textureId)
+ {
+ glUniform1i(locIndex, 1 + i);
+ return;
+ }
+ }
// Register a new active texture for the internal batch system
// NOTE: Default texture is always activated as GL_TEXTURE0