Moved glClientActiveTexture and glActiveTexture calls before glEnable(GL_TEXTURE_2D) to make sure texture unit 0 gets affected. (#523)

This commit is contained in:
binary1248 2014-05-27 10:42:04 +02:00 committed by Lukas Dürrenberger
parent ff869777a9
commit 1dae89a8e0

View File

@ -351,6 +351,13 @@ void RenderTarget::resetGLStates()
// Make sure that extensions are initialized // Make sure that extensions are initialized
priv::ensureExtensionsInit(); 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 // Define the default OpenGL states
glCheck(glDisable(GL_CULL_FACE)); glCheck(glDisable(GL_CULL_FACE));
glCheck(glDisable(GL_LIGHTING)); glCheck(glDisable(GL_LIGHTING));
@ -371,13 +378,6 @@ void RenderTarget::resetGLStates()
if (shaderAvailable) if (shaderAvailable)
applyShader(NULL); 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; m_cache.useVertexCache = false;
// Set the default view // Set the default view