-/*
-void (*qglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
-void (*qglColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
-void (*qglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
-void (*qglArrayElement)(GLint i);
-void (*qglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-void (*qglMTexCoord2f)(GLenum, GLfloat, GLfloat);
-void (*qglSelectTexture)(GLenum);
-void (*glColorTableEXT)(int, int, int, int, int, const void*);
-
-void CheckVertexArrays (void)
-{
- void *prjobj;
- if (COM_CheckParm("-novertex"))
- {
- Con_Printf("...vertex array support disabled\n");
- return;
- }
- if ((prjobj = dlopen(NULL, RTLD_LAZY)) == NULL)
- {
- Con_Printf("Unable to open symbol list for main program.\n");
- return;
- }
- qglMTexCoord2fSGIS = (void *) dlsym(prjobj, "glMTexCoord2fSGIS");
- if ((qglArrayElement = (void *) dlsym(prjobj, "glArrayElement"))
- && (qglColorPointer = (void *) dlsym(prjobj, "glColorPointer"))
-// && (qglDrawArrays = (void *) dlsym(prjobj, "glDrawArrays"))
- && (qglDrawElements = (void *) dlsym(prjobj, "glDrawElements"))
-// && (qglInterleavedArrays = (void *) dlsym(prjobj, "glInterleavedArrays"))
- && (qglTexCoordPointer = (void *) dlsym(prjobj, "glTexCoordPointer"))
- && (qglVertexPointer = (void *) dlsym(prjobj, "glVertexPointer"))
- )
- {
- Con_Printf("...vertex array support detected\n");
- gl_arrays = true;
- dlclose(prjobj);
- return;
- }
-
- Con_Printf("...vertex array support disabled (not detected - get a better driver)\n");
- dlclose(prjobj);
-}
-*/
-
-void 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");
- gl_mtexable = true;
- gl_mtex_enum = GL_TEXTURE0_ARB;
- }
- else if (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");
- gl_mtexable = true;
- gl_mtex_enum = TEXTURE0_SGIS;
- }
- if (!gl_mtexable)
- Con_Printf("...multitexture disabled (not detected)\n");
- dlclose(prjobj);
-}
-
-/*
-===============
-GL_Init
-===============
-*/
-extern char *QSG_EXTENSIONS;
-void GL_Init (void)
-{
- gl_vendor = glGetString (GL_VENDOR);
- Con_Printf ("GL_VENDOR: %s\n", gl_vendor);
- gl_renderer = glGetString (GL_RENDERER);
- Con_Printf ("GL_RENDERER: %s\n", gl_renderer);
-
- gl_version = glGetString (GL_VERSION);
- Con_Printf ("GL_VERSION: %s\n", gl_version);
- gl_extensions = glGetString (GL_EXTENSIONS);
- Con_Printf ("GL_EXTENSIONS: %s\n", gl_extensions);
-
-// Con_Printf ("%s %s\n", gl_renderer, gl_version);
-
- CheckMultiTexture();
-// CheckVertexArrays();
-
- // LordHavoc: report supported extensions
- Con_Printf ("\nQSG extensions: %s\n", QSG_EXTENSIONS);
-
- glCullFace(GL_FRONT);
- glAlphaFunc(GL_GREATER, 0.5);
-}
-