-void VID_CheckMultitexture(void)
-{
- void *prjobj;
- qglMTexCoord2f = NULL;
- qglSelectTexture = NULL;
- // Check to see if multitexture is disabled
- if (COM_CheckParm("-nomtex"))
- {
- Con_Printf("...multitexture disabled\n");
- return;
- }
- if ((prjobj = dlopen(NULL, RTLD_LAZY)) == NULL)
- {
- Con_Printf("Unable to open symbol list for main program.\n");
- return;
- }
- // Test for ARB_multitexture
- if (!COM_CheckParm("-SGISmtex") && strstr(gl_extensions, "GL_ARB_multitexture "))
- {
- Con_Printf("...using GL_ARB_multitexture\n");
- qglMTexCoord2f = (void *) dlsym(prjobj, "glMultiTexCoord2fARB");
- qglSelectTexture = (void *) dlsym(prjobj, "glActiveTextureARB");
- if (qglMTexCoord2f != NULL && qglSelectTexture != NULL)
- {
- gl_mtexable = true;
- gl_mtex_enum = GL_TEXTURE0_ARB;
- }
- else
- {
- if (qglMTexCoord2f == NULL)
- Con_Printf("dlsym(prjobj, \"glMultiTexCoord2fARB\") == NULL!\n");
- if (qglSelectTexture == NULL)
- Con_Printf("dlsym(prjobj, \"glActiveTextureARB\") == NULL!\n");
- }
- }
- if (!gl_mtexable && strstr(gl_extensions, "GL_SGIS_multitexture ")) // Test for SGIS_multitexture (if ARB_multitexture not found)
- {
- Con_Printf("...using GL_SGIS_multitexture\n");
- qglMTexCoord2f = (void *) dlsym(prjobj, "glMTexCoord2fSGIS");
- qglSelectTexture = (void *) dlsym(prjobj, "glSelectTextureSGIS");
- if (qglMTexCoord2f != NULL && qglSelectTexture != NULL)
- {
- gl_mtexable = true;
- gl_mtex_enum = TEXTURE0_SGIS;
- }
- else
- {
- if (qglMTexCoord2f == NULL)
- Con_Printf("dlsym(prjobj, \"glMTexCoord2fSGIS\") == NULL!\n");
- if (qglSelectTexture == NULL)
- Con_Printf("dlsym(prjobj, \"glSelectTextureSGIS\") == NULL!\n");
- }
- }
- if (!gl_mtexable)
- Con_Printf("...multitexture disabled (not detected)\n");
- dlclose(prjobj);
-}
-
-void VID_CheckCVA(void)
-{
- void *prjobj;
- qglLockArraysEXT = NULL;
- qglUnlockArraysEXT = NULL;
- gl_supportslockarrays = false;
- if (COM_CheckParm("-nocva"))
- {
- Con_Printf("...compiled vertex arrays disabled\n");
- return;
- }
- if ((prjobj = dlopen(NULL, RTLD_LAZY)) == NULL)
- {
- Con_Printf("Unable to open symbol list for main program.\n");
- return;
- }
- if (strstr(gl_extensions, "GL_EXT_compiled_vertex_array"))
- {
- Con_Printf("...using compiled vertex arrays\n");
- qglLockArraysEXT = (void *) dlsym(prjobj, "glLockArraysEXT");
- qglUnlockArraysEXT = (void *) dlsym(prjobj, "glUnlockArraysEXT");
- if (qglLockArraysEXT != NULL && qglUnlockArraysEXT != NULL)
- gl_supportslockarrays = true;
- else
- {
- if (qglLockArraysEXT == NULL)
- Con_Printf("dlsym(prjobj, \"glLockArraysEXT\") == NULL!\n");
- if (qglUnlockArraysEXT == NULL)
- Con_Printf("dlsym(prjobj, \"glUnlockArraysEXT\") == NULL!\n");
- Con_Printf("...compiled vertex arrays disabled\n");
- }
- }
- dlclose(prjobj);
-}
-