rice: avoid redundant gl calls
[mupen64plus-pandora.git] / source / gles2rice / src / OGLExtRender.cpp
index b87c80c..6a4f338 100644 (file)
@@ -122,6 +122,8 @@ void COGLExtRender::SetTexWrapS(int unitno,GLuint flag)
     static GLuint mtex[8];
     if( m_curBoundTex[unitno] != mtex[unitno] || mflag[unitno] != flag )
     {
+        pglActiveTexture(GL_TEXTURE0_ARB+unitno);
+        OPENGL_CHECK_ERRORS;
         mtex[unitno] = m_curBoundTex[0];
         mflag[unitno] = flag;
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, flag);
@@ -173,8 +175,6 @@ void COGLExtRender::SetTextureUFlag(TextureUVFlag dwFlag, uint32 dwTile)
     {
         if( m_textureUnitMap[textureNo] == tex )
         {
-            pglActiveTexture(GL_TEXTURE0_ARB+textureNo);
-            OPENGL_CHECK_ERRORS;
             COGLTexture* pTexture = g_textures[(gRSP.curTile+tex)&7].m_pCOGLTexture;
             if( pTexture ) 
             {