From 5945ed0424fa3aedd752e78c822277e41eef2463 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 4 May 2008 06:04:20 +0000 Subject: [PATCH] changed gl_workaround_mac_texmatrix to additionally call GL_ActiveTexture everywhere it calls GL_ClientActiveTexture git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8273 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_backend.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gl_backend.c b/gl_backend.c index 73fa632e..750a9c18 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -609,6 +609,8 @@ void GL_SetupTextureState(void) for (i = 0;i < backendarrayunits;i++) { + if (gl_workaround_mac_texmatrix.integer) + GL_ActiveTexture(i); GL_ClientActiveTexture(i); GL_BindVBO(0); qglTexCoordPointer(2, GL_FLOAT, sizeof(float[2]), NULL);CHECKGLERROR @@ -618,6 +620,8 @@ void GL_SetupTextureState(void) for (i = 0;i < backendunits;i++) { GL_ActiveTexture(i); + if (gl_workaround_mac_texmatrix.integer) + GL_ClientActiveTexture(i); qglDisable(GL_TEXTURE_1D);CHECKGLERROR qglDisable(GL_TEXTURE_2D);CHECKGLERROR if (gl_texture3d) @@ -1153,6 +1157,8 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri { if (gl_state.units[i].arrayenabled) { + if (gl_workaround_mac_texmatrix.integer) + GL_ActiveTexture(i); GL_ClientActiveTexture(i); if (!qglIsEnabled(GL_TEXTURE_COORD_ARRAY)) Con_Print("R_Mesh_Draw: texcoord array set but not enabled\n"); @@ -1546,6 +1552,8 @@ void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, co if (!unit->arrayenabled) { unit->arrayenabled = true; + if (gl_workaround_mac_texmatrix.integer) + GL_ActiveTexture(unitnum); GL_ClientActiveTexture(unitnum); qglEnableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR } @@ -1556,6 +1564,8 @@ void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, co unit->pointer_texcoord_buffer = bufferobject; unit->pointer_texcoord_offset = bufferoffset; unit->arraycomponents = numcomponents; + if (gl_workaround_mac_texmatrix.integer) + GL_ActiveTexture(unitnum); GL_ClientActiveTexture(unitnum); GL_BindVBO(bufferobject); qglTexCoordPointer(unit->arraycomponents, GL_FLOAT, sizeof(float) * unit->arraycomponents, bufferobject ? (void *)bufferoffset : texcoord);CHECKGLERROR @@ -1567,6 +1577,8 @@ void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, co if (unit->arrayenabled) { unit->arrayenabled = false; + if (gl_workaround_mac_texmatrix.integer) + GL_ActiveTexture(unitnum); GL_ClientActiveTexture(unitnum); qglDisableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR } @@ -2157,6 +2169,8 @@ void R_Mesh_ResetTextureState(void) if (unit->arrayenabled) { unit->arrayenabled = false; + if (gl_workaround_mac_texmatrix.integer) + GL_ActiveTexture(unitnum); GL_ClientActiveTexture(unitnum); qglDisableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR } -- 2.39.2