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