From 1dae89a8e0d0a1544788e385fbdac5b417e21f26 Mon Sep 17 00:00:00 2001 From: binary1248 Date: Tue, 27 May 2014 10:42:04 +0200 Subject: [PATCH] Moved glClientActiveTexture and glActiveTexture calls before glEnable(GL_TEXTURE_2D) to make sure texture unit 0 gets affected. (#523) --- src/SFML/Graphics/RenderTarget.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp index a361f7ad3..a3f03bf6a 100644 --- a/src/SFML/Graphics/RenderTarget.cpp +++ b/src/SFML/Graphics/RenderTarget.cpp @@ -351,6 +351,13 @@ void RenderTarget::resetGLStates() // Make sure that extensions are initialized priv::ensureExtensionsInit(); + // Make sure that the texture unit which is active is the number 0 + if (GLEXT_multitexture) + { + glCheck(GLEXT_glClientActiveTexture(GLEXT_GL_TEXTURE0)); + glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0)); + } + // Define the default OpenGL states glCheck(glDisable(GL_CULL_FACE)); glCheck(glDisable(GL_LIGHTING)); @@ -371,13 +378,6 @@ void RenderTarget::resetGLStates() if (shaderAvailable) applyShader(NULL); - // Make sure that the texture unit which is active is the number 0 - if (GLEXT_multitexture) - { - glCheck(GLEXT_glClientActiveTexture(GLEXT_GL_TEXTURE0)); - glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0)); - } - m_cache.useVertexCache = false; // Set the default view