From c7499f8a68e1b9816cb44321c45b45c4874d89e8 Mon Sep 17 00:00:00 2001 From: Joseph Carter Date: Sat, 10 Jun 2000 21:48:15 +0000 Subject: [PATCH] removing the bindtexture extension --- include/glquake.h | 3 --- source/gl_draw.c | 6 +----- source/vid_wgl.c | 53 +++-------------------------------------------- 3 files changed, 4 insertions(+), 58 deletions(-) diff --git a/include/glquake.h b/include/glquake.h index 349e79f..1060102 100644 --- a/include/glquake.h +++ b/include/glquake.h @@ -75,7 +75,6 @@ typedef void (GLAPIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *, const GLclampf *); typedef void (GLAPIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *); -extern BINDTEXFUNCPTR bindTexFunc; extern DELTEXFUNCPTR delTexFunc; extern TEXSUBIMAGEPTR TexSubImage2DFunc; @@ -265,8 +264,6 @@ void R_DrawSkyChain (msurface_t *s); void R_LoadSkys (char *); void R_ClearSkyBox (void); void R_DrawSkyBox (void); -byte *LoadTGA (FILE *fin); -byte *LoadPCX (FILE *f); // // gl_draw.c diff --git a/source/gl_draw.c b/source/gl_draw.c index 82934b2..99fd06b 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -129,11 +129,7 @@ void GL_Bind (int texnum) if (currenttexture == texnum) return; currenttexture = texnum; -#ifdef _WIN32 - bindTexFunc (GL_TEXTURE_2D, texnum); -#else glBindTexture (GL_TEXTURE_2D, texnum); -#endif } @@ -1405,7 +1401,7 @@ void GL_SelectTexture (GLenum target) { if (!gl_mtexable) return; - qglSelectTexture(target+gl_mtex_enum); + qglSelectTexture (target + gl_mtex_enum); if (target == oldtarget) return; cnttextures[oldtarget] = currenttexture; diff --git a/source/vid_wgl.c b/source/vid_wgl.c index c2d5192..c0dd411 100644 --- a/source/vid_wgl.c +++ b/source/vid_wgl.c @@ -152,8 +152,6 @@ typedef void (APIENTRY *lp3DFXFUNC) (int, int, int, int, int, const void*); lp3DFXFUNC glColorTableEXT; qboolean is8bit = false; qboolean isPermedia = false; -int gl_mtex_enum = TEXTURE0_SGIS; -qboolean gl_arb_mtex = false; qboolean gl_mtexable = false; //==================================== @@ -519,51 +517,6 @@ void VID_UpdateWindowStatus (void) } -//==================================== - -BINDTEXFUNCPTR bindTexFunc; - -#define TEXTURE_EXT_STRING "GL_EXT_texture_object" - - -void CheckTextureExtensions (void) -{ - char *tmp; - qboolean texture_ext; - HINSTANCE hInstGL; - - texture_ext = FALSE; - /* check for texture extension */ - tmp = (unsigned char *)glGetString(GL_EXTENSIONS); - while (*tmp) - { - if (strncmp((const char*)tmp, TEXTURE_EXT_STRING, strlen(TEXTURE_EXT_STRING)) == 0) - texture_ext = TRUE; - tmp++; - } - - if (!texture_ext || COM_CheckParm ("-gl11") ) - { - hInstGL = LoadLibrary("opengl32.dll"); - - if (hInstGL == NULL) - Sys_Error ("Couldn't load opengl32.dll\n"); - - bindTexFunc = (void *)GetProcAddress(hInstGL,"glBindTexture"); - - if (!bindTexFunc) - Sys_Error ("No texture objects!"); - return; - } - -/* load library and get procedure adresses for texture extension API */ - if ((bindTexFunc = (BINDTEXFUNCPTR) - wglGetProcAddress((LPCSTR) "glBindTextureEXT")) == NULL) - { - Sys_Error ("GetProcAddress for BindTextureEXT failed"); - return; - } -} void CheckArrayExtensions (void) { @@ -614,9 +567,9 @@ void CheckMultiTextureExtensions(void) { Con_Printf ("GL_ARB_multitexture\n"); qglMTexCoord2f = - (void *)wglGetProcAddress("glMultiTexCoord2fARB"); - qglSelectTexture = - (void *) wglGetProcAddress("glActiveTextureARB"); + (void *)wglGetProcAddress("glMTexCoord2fARB"); + qglSelectTexture = + (void *)wglGetProcAddress("glSelectTextureARB"); gl_mtex_enum = GL_TEXTURE0_ARB; gl_mtexable = true; gl_arb_mtex = true;