Permalink
Browse files

gl: make sure we detach textures and disable texturing on all gl stages

When limited range colors was in use, we could end up adjusting range
twice since the last texture stage could be left around modifying
following render.
  • Loading branch information...
1 parent c0ee12a commit 6bf20edaf914d850ad02a4d5861f922782abb631 @elupus elupus committed Jan 8, 2014
Showing with 11 additions and 2 deletions.
  1. +4 −0 xbmc/guilib/GUIFontTTFGL.cpp
  2. +7 −2 xbmc/guilib/GUITextureGL.cpp
@@ -146,8 +146,12 @@ void CGUIFontTTFGL::End()
glDrawArrays(GL_QUADS, 0, m_vertex_count);
glPopClientAttrib();
+ glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_TEXTURE_2D);
glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_TEXTURE_2D);
#else
// GLES 2.0 version. Cannot draw quads. Convert to triangles.
GLint posLoc = g_Windowing.GUIShaderGetPos();
@@ -118,9 +118,14 @@ void CGUITextureGL::Begin(color_t color)
void CGUITextureGL::End()
{
glEnd();
- if (m_diffuse.size())
- glDisable(GL_TEXTURE_2D);
+ glActiveTexture(GL_TEXTURE2_ARB);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_TEXTURE_2D);
+ glActiveTexture(GL_TEXTURE1_ARB);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_TEXTURE_2D);
glActiveTexture(GL_TEXTURE0_ARB);
+ glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
}

0 comments on commit 6bf20ed

Please sign in to comment.