- Confirmed rename of GL_TEXTURE0/1 because they conflict

with OpenGL 1.3 definitions.  Renamed GL_Texture0 to
  QGL_TEXTURE0, for consistency.  (icculus patchset #15)
This commit is contained in:
Jamie Wilkinson 2002-12-01 05:48:57 +00:00
parent 8cf067fc33
commit 1f8f0480ef
4 changed files with 53 additions and 53 deletions

View file

@ -75,17 +75,17 @@ void GL_EnableMultitexture( qboolean enable )
if ( enable ) if ( enable )
{ {
GL_SelectTexture( GL_Texture1 ); GL_SelectTexture( QGL_TEXTURE1 );
qglEnable( GL_TEXTURE_2D ); qglEnable( GL_TEXTURE_2D );
GL_TexEnv( GL_REPLACE ); GL_TexEnv( GL_REPLACE );
} }
else else
{ {
GL_SelectTexture( GL_Texture1 ); GL_SelectTexture( QGL_TEXTURE1 );
qglDisable( GL_TEXTURE_2D ); qglDisable( GL_TEXTURE_2D );
GL_TexEnv( GL_REPLACE ); GL_TexEnv( GL_REPLACE );
} }
GL_SelectTexture( GL_Texture0 ); GL_SelectTexture( QGL_TEXTURE0 );
GL_TexEnv( GL_REPLACE ); GL_TexEnv( GL_REPLACE );
} }
@ -96,7 +96,7 @@ void GL_SelectTexture( GLenum texture )
if ( !qglSelectTextureSGIS && !qglActiveTextureARB ) if ( !qglSelectTextureSGIS && !qglActiveTextureARB )
return; return;
if ( texture == GL_Texture0 ) if ( texture == QGL_TEXTURE0 )
{ {
tmu = 0; tmu = 0;
} }
@ -149,7 +149,7 @@ void GL_Bind (int texnum)
void GL_MBind( GLenum target, int texnum ) void GL_MBind( GLenum target, int texnum )
{ {
GL_SelectTexture( target ); GL_SelectTexture( target );
if ( target == GL_Texture0 ) if ( target == QGL_TEXTURE0 )
{ {
if ( gl_state.currenttextures[0] == texnum ) if ( gl_state.currenttextures[0] == texnum )
return; return;

View file

@ -32,7 +32,7 @@ viddef_t vid;
refimport_t ri; refimport_t ri;
int GL_Texture0, GL_Texture1; int QGL_TEXTURE0, QGL_TEXTURE1;
model_t *r_worldmodel; model_t *r_worldmodel;
@ -1367,8 +1367,8 @@ qboolean R_Init( void *hinstance, void *hWnd )
qglMTexCoord2fSGIS = (void(APIENTRY*)(GLenum, GLfloat, GLfloat)) qwglGetProcAddress( "glMultiTexCoord2fARB" ); qglMTexCoord2fSGIS = (void(APIENTRY*)(GLenum, GLfloat, GLfloat)) qwglGetProcAddress( "glMultiTexCoord2fARB" );
qglActiveTextureARB = (void(APIENTRY*)(GLenum)) qwglGetProcAddress( "glActiveTextureARB" ); qglActiveTextureARB = (void(APIENTRY*)(GLenum)) qwglGetProcAddress( "glActiveTextureARB" );
qglClientActiveTextureARB = (void(APIENTRY*)(GLenum)) qwglGetProcAddress( "glClientActiveTextureARB" ); qglClientActiveTextureARB = (void(APIENTRY*)(GLenum)) qwglGetProcAddress( "glClientActiveTextureARB" );
GL_Texture0 = GL_TEXTURE0_ARB; QGL_TEXTURE0 = GL_TEXTURE0_ARB;
GL_Texture1 = GL_TEXTURE1_ARB; QGL_TEXTURE1 = GL_TEXTURE1_ARB;
} }
else else
{ {
@ -1391,8 +1391,8 @@ qboolean R_Init( void *hinstance, void *hWnd )
ri.Con_Printf( PRINT_ALL, "...using GL_SGIS_multitexture\n" ); ri.Con_Printf( PRINT_ALL, "...using GL_SGIS_multitexture\n" );
qglMTexCoord2fSGIS = (void(APIENTRY*)(GLenum, GLfloat, GLfloat)) qwglGetProcAddress( "glMTexCoord2fSGIS" ); qglMTexCoord2fSGIS = (void(APIENTRY*)(GLenum, GLfloat, GLfloat)) qwglGetProcAddress( "glMTexCoord2fSGIS" );
qglSelectTextureSGIS = (void(APIENTRY*)(GLenum)) qwglGetProcAddress( "glSelectTextureSGIS" ); qglSelectTextureSGIS = (void(APIENTRY*)(GLenum)) qwglGetProcAddress( "glSelectTextureSGIS" );
GL_Texture0 = GL_TEXTURE0_SGIS; QGL_TEXTURE0 = GL_TEXTURE0_SGIS;
GL_Texture1 = GL_TEXTURE1_SGIS; QGL_TEXTURE1 = GL_TEXTURE1_SGIS;
} }
else else
{ {

View file

@ -1,23 +1,25 @@
/* /* $Id$
Copyright (C) 1997-2001 Id Software, Inc. *
* surface related OpenGL refresh code
This program is free software; you can redistribute it and/or *
modify it under the terms of the GNU General Public License * Copyright (C) 1997-2001 Id Software, Inc.
as published by the Free Software Foundation; either version 2 * Copyright (c) 2002 The Quakeforge Project.
of the License, or (at your option) any later version. *
* This program is free software; you can redistribute it and/or
This program is distributed in the hope that it will be useful, * modify it under the terms of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of * as published by the Free Software Foundation; either version 2
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * of the License, or (at your option) any later version.
*
See the GNU General Public License for more details. * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
You should have received a copy of the GNU General Public License * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
along with this program; if not, write to the Free Software *
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * See the GNU General Public License for more details.
*
*/ * You should have received a copy of the GNU General Public License
// GL_RSURF.C: surface-related refresh code * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <ctype.h> #include <ctype.h>
@ -744,7 +746,7 @@ dynamic:
R_BuildLightMap( surf, (void *)temp, smax*4 ); R_BuildLightMap( surf, (void *)temp, smax*4 );
R_SetCacheState( surf ); R_SetCacheState( surf );
GL_MBind( GL_Texture1, gl_state.lightmap_textures + surf->lightmaptexturenum ); GL_MBind( QGL_TEXTURE1, gl_state.lightmap_textures + surf->lightmaptexturenum );
lmtex = surf->lightmaptexturenum; lmtex = surf->lightmaptexturenum;
@ -762,7 +764,7 @@ dynamic:
R_BuildLightMap( surf, (void *)temp, smax*4 ); R_BuildLightMap( surf, (void *)temp, smax*4 );
GL_MBind( GL_Texture1, gl_state.lightmap_textures + 0 ); GL_MBind( QGL_TEXTURE1, gl_state.lightmap_textures + 0 );
lmtex = 0; lmtex = 0;
@ -776,8 +778,8 @@ dynamic:
c_brush_polys++; c_brush_polys++;
GL_MBind( GL_Texture0, image->texnum ); GL_MBind( QGL_TEXTURE0, image->texnum );
GL_MBind( GL_Texture1, gl_state.lightmap_textures + lmtex ); GL_MBind( QGL_TEXTURE1, gl_state.lightmap_textures + lmtex );
//========== //==========
//PGM //PGM
@ -795,8 +797,8 @@ dynamic:
qglBegin (GL_POLYGON); qglBegin (GL_POLYGON);
for (i=0 ; i< nv; i++, v+= VERTEXSIZE) for (i=0 ; i< nv; i++, v+= VERTEXSIZE)
{ {
qglMTexCoord2fSGIS( GL_Texture0, (v[3]+scroll), v[4]); qglMTexCoord2fSGIS( QGL_TEXTURE0, (v[3]+scroll), v[4]);
qglMTexCoord2fSGIS( GL_Texture1, v[5], v[6]); qglMTexCoord2fSGIS( QGL_TEXTURE1, v[5], v[6]);
qglVertex3fv (v); qglVertex3fv (v);
} }
qglEnd (); qglEnd ();
@ -810,8 +812,8 @@ dynamic:
qglBegin (GL_POLYGON); qglBegin (GL_POLYGON);
for (i=0 ; i< nv; i++, v+= VERTEXSIZE) for (i=0 ; i< nv; i++, v+= VERTEXSIZE)
{ {
qglMTexCoord2fSGIS( GL_Texture0, v[3], v[4]); qglMTexCoord2fSGIS( QGL_TEXTURE0, v[3], v[4]);
qglMTexCoord2fSGIS( GL_Texture1, v[5], v[6]); qglMTexCoord2fSGIS( QGL_TEXTURE1, v[5], v[6]);
qglVertex3fv (v); qglVertex3fv (v);
} }
qglEnd (); qglEnd ();
@ -824,8 +826,8 @@ dynamic:
{ {
c_brush_polys++; c_brush_polys++;
GL_MBind( GL_Texture0, image->texnum ); GL_MBind( QGL_TEXTURE0, image->texnum );
GL_MBind( GL_Texture1, gl_state.lightmap_textures + lmtex ); GL_MBind( QGL_TEXTURE1, gl_state.lightmap_textures + lmtex );
//========== //==========
//PGM //PGM
@ -843,8 +845,8 @@ dynamic:
qglBegin (GL_POLYGON); qglBegin (GL_POLYGON);
for (i=0 ; i< nv; i++, v+= VERTEXSIZE) for (i=0 ; i< nv; i++, v+= VERTEXSIZE)
{ {
qglMTexCoord2fSGIS( GL_Texture0, (v[3]+scroll), v[4]); qglMTexCoord2fSGIS( QGL_TEXTURE0, (v[3]+scroll), v[4]);
qglMTexCoord2fSGIS( GL_Texture1, v[5], v[6]); qglMTexCoord2fSGIS( QGL_TEXTURE1, v[5], v[6]);
qglVertex3fv (v); qglVertex3fv (v);
} }
qglEnd (); qglEnd ();
@ -860,8 +862,8 @@ dynamic:
qglBegin (GL_POLYGON); qglBegin (GL_POLYGON);
for (i=0 ; i< nv; i++, v+= VERTEXSIZE) for (i=0 ; i< nv; i++, v+= VERTEXSIZE)
{ {
qglMTexCoord2fSGIS( GL_Texture0, v[3], v[4]); qglMTexCoord2fSGIS( QGL_TEXTURE0, v[3], v[4]);
qglMTexCoord2fSGIS( GL_Texture1, v[5], v[6]); qglMTexCoord2fSGIS( QGL_TEXTURE1, v[5], v[6]);
qglVertex3fv (v); qglVertex3fv (v);
} }
qglEnd (); qglEnd ();
@ -1013,9 +1015,9 @@ e->angles[0] = -e->angles[0]; // stupid quake bug
e->angles[2] = -e->angles[2]; // stupid quake bug e->angles[2] = -e->angles[2]; // stupid quake bug
GL_EnableMultitexture( true ); GL_EnableMultitexture( true );
GL_SelectTexture( GL_Texture0); GL_SelectTexture( QGL_TEXTURE0);
GL_TexEnv( GL_REPLACE ); GL_TexEnv( GL_REPLACE );
GL_SelectTexture( GL_Texture1); GL_SelectTexture( QGL_TEXTURE1);
GL_TexEnv( GL_MODULATE ); GL_TexEnv( GL_MODULATE );
R_DrawInlineBModel (); R_DrawInlineBModel ();
@ -1227,9 +1229,9 @@ void R_DrawWorld (void)
{ {
GL_EnableMultitexture( true ); GL_EnableMultitexture( true );
GL_SelectTexture( GL_Texture0); GL_SelectTexture( QGL_TEXTURE0);
GL_TexEnv( GL_REPLACE ); GL_TexEnv( GL_REPLACE );
GL_SelectTexture( GL_Texture1); GL_SelectTexture( QGL_TEXTURE1);
if ( gl_lightmap->value ) if ( gl_lightmap->value )
GL_TexEnv( GL_REPLACE ); GL_TexEnv( GL_REPLACE );
@ -1577,7 +1579,7 @@ void GL_BeginBuildingLightmaps (model_t *m)
r_framecount = 1; // no dlightcache r_framecount = 1; // no dlightcache
GL_EnableMultitexture( true ); GL_EnableMultitexture( true );
GL_SelectTexture( GL_Texture1); GL_SelectTexture( QGL_TEXTURE1);
/* /*
** setup the base lightstyles so the lightmaps won't have to be regenerated ** setup the base lightstyles so the lightmaps won't have to be regenerated

View file

@ -18,8 +18,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* 02111-1307, USA.
*/ */
#ifndef __QGL_H__ #ifndef __QGL_H__
@ -492,7 +491,6 @@ extern void (*qgl3DfxSetPaletteEXT)(GLuint *);
#endif // HAVE_OPENGL_GLEXT, end of glext.h defines #endif // HAVE_OPENGL_GLEXT, end of glext.h defines
extern int QGL_TEXTURE0, QGL_TEXTURE1;
extern int GL_Texture0, GL_Texture1;
#endif /* __QGL_H__ */ #endif /* __QGL_H__ */