mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-19 02:22:01 +00:00
gl_vidnt.c, gl_vidsdl.c: Reformatted GL_CheckExtensions for better readability,
removed the old unused CheckArrayExtensions. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@348 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
6fe1dbab48
commit
7fddf9abdc
2 changed files with 135 additions and 177 deletions
|
@ -965,37 +965,6 @@ void GL_Info_f (void)
|
|||
Con_Printf ("WGL_EXTENSIONS: %s\n", wgl_extensions_nice);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CheckArrayExtensions
|
||||
===============
|
||||
*/
|
||||
#if 0 /* unused */
|
||||
void CheckArrayExtensions (void)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
tmp = (const char *)glGetString(GL_EXTENSIONS);
|
||||
while (*tmp)
|
||||
{
|
||||
if (strncmp(tmp, "GL_EXT_vertex_array", sizeof("GL_EXT_vertex_array") -1) == 0)
|
||||
{
|
||||
if (((glArrayElementEXT = wglGetProcAddress("glArrayElementEXT")) == NULL) ||
|
||||
((glColorPointerEXT = wglGetProcAddress("glColorPointerEXT")) == NULL) ||
|
||||
((glTexCoordPointerEXT = wglGetProcAddress("glTexCoordPointerEXT")) == NULL) ||
|
||||
((glVertexPointerEXT = wglGetProcAddress("glVertexPointerEXT")) == NULL) )
|
||||
{
|
||||
Sys_Error ("GetProcAddress for vertex extension failed");
|
||||
}
|
||||
return;
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
|
||||
Sys_Error ("Vertex array extension not present");
|
||||
}
|
||||
#endif /* #if 0 */
|
||||
|
||||
/*
|
||||
===============
|
||||
GL_CheckExtensions -- johnfitz
|
||||
|
@ -1008,8 +977,7 @@ void GL_CheckExtensions (void)
|
|||
//
|
||||
if (COM_CheckParm("-nomtex"))
|
||||
Con_Warning ("Mutitexture disabled at command line\n");
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_ARB_multitexture"))
|
||||
else if (strstr(gl_extensions, "GL_ARB_multitexture"))
|
||||
{
|
||||
GL_MTexCoord2fFunc = (void *) wglGetProcAddress("glMultiTexCoord2fARB");
|
||||
GL_SelectTextureFunc = (void *) wglGetProcAddress("glActiveTextureARB");
|
||||
|
@ -1021,10 +989,11 @@ void GL_CheckExtensions (void)
|
|||
gl_mtexable = true;
|
||||
}
|
||||
else
|
||||
Con_Warning ("multitexture not supported (wglGetProcAddress failed)\n");
|
||||
{
|
||||
Con_Warning ("Couldn't link to multitexture functions\n");
|
||||
}
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_SGIS_multitexture"))
|
||||
}
|
||||
else if (strstr(gl_extensions, "GL_SGIS_multitexture"))
|
||||
{
|
||||
GL_MTexCoord2fFunc = (void *) wglGetProcAddress("glMTexCoord2fSGIS");
|
||||
GL_SelectTextureFunc = (void *) wglGetProcAddress("glSelectTextureSGIS");
|
||||
|
@ -1036,49 +1005,54 @@ void GL_CheckExtensions (void)
|
|||
gl_mtexable = true;
|
||||
}
|
||||
else
|
||||
Con_Warning ("multitexture not supported (wglGetProcAddress failed)\n");
|
||||
|
||||
{
|
||||
Con_Warning ("Couldn't link to multitexture functions\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("multitexture not supported (extension not found)\n");
|
||||
}
|
||||
|
||||
//
|
||||
// texture_env_combine
|
||||
//
|
||||
if (COM_CheckParm("-nocombine"))
|
||||
Con_Warning ("texture_env_combine disabled at command line\n");
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_ARB_texture_env_combine"))
|
||||
else if (strstr(gl_extensions, "GL_ARB_texture_env_combine"))
|
||||
{
|
||||
Con_Printf("FOUND: ARB_texture_env_combine\n");
|
||||
gl_texture_env_combine = true;
|
||||
}
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_EXT_texture_env_combine"))
|
||||
else if (strstr(gl_extensions, "GL_EXT_texture_env_combine"))
|
||||
{
|
||||
Con_Printf("FOUND: EXT_texture_env_combine\n");
|
||||
gl_texture_env_combine = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("texture_env_combine not supported\n");
|
||||
}
|
||||
|
||||
//
|
||||
// texture_env_add
|
||||
//
|
||||
if (COM_CheckParm("-noadd"))
|
||||
Con_Warning ("texture_env_add disabled at command line\n");
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_ARB_texture_env_add"))
|
||||
else if (strstr(gl_extensions, "GL_ARB_texture_env_add"))
|
||||
{
|
||||
Con_Printf("FOUND: ARB_texture_env_add\n");
|
||||
gl_texture_env_add = true;
|
||||
}
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_EXT_texture_env_add"))
|
||||
else if (strstr(gl_extensions, "GL_EXT_texture_env_add"))
|
||||
{
|
||||
Con_Printf("FOUND: EXT_texture_env_add\n");
|
||||
gl_texture_env_add = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("texture_env_add not supported\n");
|
||||
}
|
||||
|
||||
//
|
||||
// swap control
|
||||
|
@ -1101,10 +1075,14 @@ void GL_CheckExtensions (void)
|
|||
}
|
||||
}
|
||||
else
|
||||
Con_Warning ("vertical sync not supported (wglGetProcAddress failed)\n");
|
||||
{
|
||||
Con_Warning ("Couldn't link to vertical sync functions\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("vertical sync not supported (extension not found)\n");
|
||||
}
|
||||
|
||||
//
|
||||
// anisotropic filtering
|
||||
|
@ -1130,14 +1108,18 @@ void GL_CheckExtensions (void)
|
|||
gl_anisotropy_able = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("anisotropic filtering locked by driver. Current driver setting is %f\n", test1);
|
||||
}
|
||||
|
||||
//get max value either way, so the menu and stuff know it
|
||||
glGetFloatv (GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max_anisotropy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("texture_filter_anisotropic not supported\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
|
|
|
@ -560,37 +560,6 @@ void GL_Info_f (void)
|
|||
Con_Printf ("GL_EXTENSIONS: %s\n", gl_extensions_nice);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CheckArrayExtensions
|
||||
===============
|
||||
*/
|
||||
#if 0 /* unused */
|
||||
void CheckArrayExtensions (void)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
tmp = (const char *)glGetString(GL_EXTENSIONS);
|
||||
while (*tmp)
|
||||
{
|
||||
if (strncmp(tmp, "GL_EXT_vertex_array", sizeof("GL_EXT_vertex_array") -1) == 0)
|
||||
{
|
||||
if (((glArrayElementEXT = SDL_GL_GetProcAddress("glArrayElementEXT")) == NULL) ||
|
||||
((glColorPointerEXT = SDL_GL_GetProcAddress("glColorPointerEXT")) == NULL) ||
|
||||
((glTexCoordPointerEXT = SDL_GL_GetProcAddress("glTexCoordPointerEXT")) == NULL) ||
|
||||
((glVertexPointerEXT = SDL_GL_GetProcAddress("glVertexPointerEXT")) == NULL) )
|
||||
{
|
||||
Sys_Error ("GetProcAddress for vertex extension failed");
|
||||
}
|
||||
return;
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
|
||||
Sys_Error ("Vertex array extension not present");
|
||||
}
|
||||
#endif /* #if 0 */
|
||||
|
||||
/*
|
||||
===============
|
||||
GL_CheckExtensions -- johnfitz
|
||||
|
@ -605,13 +574,10 @@ void GL_CheckExtensions (void)
|
|||
//
|
||||
if (COM_CheckParm("-nomtex"))
|
||||
Con_Warning ("Mutitexture disabled at command line\n");
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_ARB_multitexture"))
|
||||
else if (strstr(gl_extensions, "GL_ARB_multitexture"))
|
||||
{
|
||||
GL_MTexCoord2fFunc = (PFNGLMULTITEXCOORD2FARBPROC)
|
||||
SDL_GL_GetProcAddress("glMultiTexCoord2fARB");
|
||||
GL_SelectTextureFunc = (PFNGLACTIVETEXTUREARBPROC)
|
||||
SDL_GL_GetProcAddress("glActiveTextureARB");
|
||||
GL_MTexCoord2fFunc = (PFNGLMULTITEXCOORD2FARBPROC) SDL_GL_GetProcAddress("glMultiTexCoord2fARB");
|
||||
GL_SelectTextureFunc = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
|
||||
if (GL_MTexCoord2fFunc && GL_SelectTextureFunc)
|
||||
{
|
||||
Con_Printf("FOUND: ARB_multitexture\n");
|
||||
|
@ -620,15 +586,14 @@ void GL_CheckExtensions (void)
|
|||
gl_mtexable = true;
|
||||
}
|
||||
else
|
||||
Con_Warning ("multitexture not supported (SDL_GL_GetProcAddress failed)\n");
|
||||
}
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_SGIS_multitexture"))
|
||||
{
|
||||
GL_MTexCoord2fFunc = (PFNGLMULTITEXCOORD2FARBPROC)
|
||||
SDL_GL_GetProcAddress("glMTexCoord2fSGIS");
|
||||
GL_SelectTextureFunc = (PFNGLACTIVETEXTUREARBPROC)
|
||||
SDL_GL_GetProcAddress("glSelectTextureSGIS");
|
||||
Con_Warning ("Couldn't link to multitexture functions\n");
|
||||
}
|
||||
}
|
||||
else if (strstr(gl_extensions, "GL_SGIS_multitexture"))
|
||||
{
|
||||
GL_MTexCoord2fFunc = (PFNGLMULTITEXCOORD2FARBPROC) SDL_GL_GetProcAddress("glMTexCoord2fSGIS");
|
||||
GL_SelectTextureFunc = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glSelectTextureSGIS");
|
||||
if (GL_MTexCoord2fFunc && GL_SelectTextureFunc)
|
||||
{
|
||||
Con_Printf("FOUND: SGIS_multitexture\n");
|
||||
|
@ -637,49 +602,54 @@ void GL_CheckExtensions (void)
|
|||
gl_mtexable = true;
|
||||
}
|
||||
else
|
||||
Con_Warning ("multitexture not supported (SDL_GL_GetProcAddress failed)\n");
|
||||
|
||||
{
|
||||
Con_Warning ("Couldn't link to multitexture functions\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("multitexture not supported (extension not found)\n");
|
||||
}
|
||||
|
||||
//
|
||||
// texture_env_combine
|
||||
//
|
||||
if (COM_CheckParm("-nocombine"))
|
||||
Con_Warning ("texture_env_combine disabled at command line\n");
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_ARB_texture_env_combine"))
|
||||
else if (strstr(gl_extensions, "GL_ARB_texture_env_combine"))
|
||||
{
|
||||
Con_Printf("FOUND: ARB_texture_env_combine\n");
|
||||
gl_texture_env_combine = true;
|
||||
}
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_EXT_texture_env_combine"))
|
||||
else if (strstr(gl_extensions, "GL_EXT_texture_env_combine"))
|
||||
{
|
||||
Con_Printf("FOUND: EXT_texture_env_combine\n");
|
||||
gl_texture_env_combine = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("texture_env_combine not supported\n");
|
||||
}
|
||||
|
||||
//
|
||||
// texture_env_add
|
||||
//
|
||||
if (COM_CheckParm("-noadd"))
|
||||
Con_Warning ("texture_env_add disabled at command line\n");
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_ARB_texture_env_add"))
|
||||
else if (strstr(gl_extensions, "GL_ARB_texture_env_add"))
|
||||
{
|
||||
Con_Printf("FOUND: ARB_texture_env_add\n");
|
||||
gl_texture_env_add = true;
|
||||
}
|
||||
else
|
||||
if (strstr(gl_extensions, "GL_EXT_texture_env_add"))
|
||||
else if (strstr(gl_extensions, "GL_EXT_texture_env_add"))
|
||||
{
|
||||
Con_Printf("FOUND: EXT_texture_env_add\n");
|
||||
gl_texture_env_add = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("texture_env_add not supported\n");
|
||||
}
|
||||
|
||||
//
|
||||
// swap control
|
||||
|
@ -709,7 +679,9 @@ void GL_CheckExtensions (void)
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("vertical sync not supported (extension not found)\n");
|
||||
}
|
||||
|
||||
//
|
||||
// anisotropic filtering
|
||||
|
@ -735,14 +707,18 @@ void GL_CheckExtensions (void)
|
|||
gl_anisotropy_able = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("anisotropic filtering locked by driver. Current driver setting is %f\n", test1);
|
||||
}
|
||||
|
||||
//get max value either way, so the menu and stuff know it
|
||||
glGetFloatv (GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max_anisotropy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("texture_filter_anisotropic not supported\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
|
|
Loading…
Reference in a new issue