GLX now supports EXT_multitexture if you've got it, one more step

toward real ARB_multitexture.
This commit is contained in:
Joseph Carter 2000-06-05 12:22:22 +00:00
parent a3e32e213e
commit c1f7cef497

View file

@ -140,6 +140,10 @@ const char *gl_version;
const char *gl_extensions; const char *gl_extensions;
qboolean is8bit = false; qboolean is8bit = false;
// ARB Multitexture
int gl_mtex_enum = TEXTURE0_SGIS;
qboolean gl_arb_mtex = false;
qboolean gl_mtexable = false; qboolean gl_mtexable = false;
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
@ -292,18 +296,34 @@ void VID_SetPalette (unsigned char *palette)
void void
CheckMultiTextureExtensions ( void ) CheckMultiTextureExtensions ( void )
{ {
if (COM_CheckParm ("-nomtex"))
{
Con_Printf ("Not using multitexture.");
return;
}
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
dlhand = dlopen (NULL, RTLD_LAZY); dlhand = dlopen (NULL, RTLD_LAZY);
if (dlhand) if (dlhand != NULL)
{ {
if (strstr(gl_extensions, "GL_SGIS_multitexture ") && !COM_CheckParm("-nomtex")) Con_Printf("Multitexture enabled ");
if (strstr(gl_extensions, "GL_SGIS_multitexture "))
{ {
Con_Printf("Multitexture extensions found.\n"); Con_Printf ("(SGIS)\n");
qglMTexCoord2fSGIS = (void *)dlsym(dlhand, "glMTexCoord2fSGIS"); qglMTexCoord2fSGIS =
qglSelectTextureSGIS = (void *)dlsym(dlhand, "glSelectTextureSGIS"); (void *)dlsym(dlhand, "glMTexCoord2fSGIS");
qglSelectTextureSGIS =
(void *)dlsym(dlhand, "glSelectTextureSGIS");
gl_mtexable = true;
} else if (strstr(gl_extensions, "GL_EXT_multitexture "))
{
Con_Printf ("(EXT)\n");
qglMTexCoord2fSGIS =
(void *)dlsym(dlhand, "glMTexCoord2fEXT");
qglSelectTextureSGIS =
(void *)dlsym(dlhand, "glSelectTextureEXT");
gl_mtexable = true; gl_mtexable = true;
} else { } else {
Con_Printf ("Not using multitexture extensions.\n"); Con_Printf ("(but not found)\n");
} }
dlclose(dlhand); dlclose(dlhand);
dlhand = NULL; dlhand = NULL;
@ -311,7 +331,6 @@ CheckMultiTextureExtensions ( void )
} }
#else #else
gl_mtexable = false; gl_mtexable = false;
Con_Printf ("No dlopen\n");
#endif #endif
} }