ecere/gfx/drivers/OpenGL: Fixed texturing set up
authorJerome St-Louis <jerome@ecere.com>
Wed, 3 Aug 2016 00:09:24 +0000 (20:09 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 3 Aug 2016 00:09:24 +0000 (20:09 -0400)
- Bump map / cube map / diffuse map confusion...

ecere/src/gfx/drivers/OpenGLDisplayDriver.ec

index 888dc8c..a2525e9 100644 (file)
@@ -3437,11 +3437,6 @@ class OpenGLDisplayDriver : DisplayDriver
 #if ENABLE_GL_FFP
          if(!glCaps_shaders)
          {
-            if(tmu > 1)
-            {
-               oglMesh.texCoords.use(texCoord, 2, GL_FLOAT, 0, oglMesh.texCoords.buffer ? null : mesh.texCoords);
-               GLEnableClientState(TEXCOORDS);
-            }
             glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
             /* // This did not have the desired effect with a GL_ALPHA texture
             glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
@@ -3478,6 +3473,8 @@ class OpenGLDisplayDriver : DisplayDriver
                glEnable(GL_TEXTURE_GEN_S);
                glEnable(GL_TEXTURE_GEN_T);
             #endif
+
+               GLDisableClientState(TEXCOORDS);
             }
             else
             {
@@ -3488,6 +3485,10 @@ class OpenGLDisplayDriver : DisplayDriver
                glDisable(GL_TEXTURE_GEN_S);
                glDisable(GL_TEXTURE_GEN_T);
             #endif
+
+               if(tmu > 1)
+                  oglMesh.texCoords.use(texCoord, 2, GL_FLOAT, 0, oglMesh.texCoords.buffer ? null : mesh.texCoords);
+               GLEnableClientState(TEXCOORDS);
             }
             glClientActiveTexture(GL_TEXTURE0);
          }