Some cleanup
This commit is contained in:
parent
2c8c9dbf18
commit
2d0e36fd8f
1 changed files with 56 additions and 56 deletions
112
gl_common.c
112
gl_common.c
|
@ -46,12 +46,12 @@ GL3DFXSETPALETTEEXTPFN qgl3DfxSetPaletteEXT;
|
||||||
|
|
||||||
PFNBLENDCOLORPROC qglBlendColorEXT;
|
PFNBLENDCOLORPROC qglBlendColorEXT;
|
||||||
|
|
||||||
// EXT_stencil_two_side
|
// EXT_stencil_two_side
|
||||||
PFNGLACTIVESTENCILFACEEXTPROC qglActiveStencilFaceEXT;
|
PFNGLACTIVESTENCILFACEEXTPROC qglActiveStencilFaceEXT;
|
||||||
|
|
||||||
// ATI_separate_stencil
|
// ATI_separate_stencil
|
||||||
PFNGLSTENCILOPSEPARATEATIPROC qglStencilOpSeparateATI;
|
PFNGLSTENCILOPSEPARATEATIPROC qglStencilOpSeparateATI;
|
||||||
PFNGLSTENCILFUNCSEPARATEATIPROC qglStencilFuncSeparateATI;
|
PFNGLSTENCILFUNCSEPARATEATIPROC qglStencilFuncSeparateATI;
|
||||||
|
|
||||||
|
|
||||||
//int texture_mode = GL_NEAREST;
|
//int texture_mode = GL_NEAREST;
|
||||||
|
@ -406,74 +406,74 @@ void CheckGL2FragmentExtensions(void)
|
||||||
void CheckAnisotropicExtension(void)
|
void CheckAnisotropicExtension(void)
|
||||||
{
|
{
|
||||||
if (strstr(gl_extensions, "GL_EXT_texture_filter_anisotropic") &&
|
if (strstr(gl_extensions, "GL_EXT_texture_filter_anisotropic") &&
|
||||||
( COM_CheckParm ("-anisotropic") || COM_CheckParm ("-anisotropy")) )
|
( COM_CheckParm ("-anisotropic") || COM_CheckParm ("-anisotropy")) )
|
||||||
{
|
{
|
||||||
GLfloat maxanisotropy;
|
GLfloat maxanisotropy;
|
||||||
|
|
||||||
if ( COM_CheckParm ("-anisotropy"))
|
if ( COM_CheckParm ("-anisotropy"))
|
||||||
gl_textureanisotropylevel = Q_atoi(com_argv[COM_CheckParm("-anisotropy")+1]);
|
gl_textureanisotropylevel = Q_atoi(com_argv[COM_CheckParm("-anisotropy")+1]);
|
||||||
|
|
||||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxanisotropy);
|
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxanisotropy);
|
||||||
if ( gl_textureanisotropylevel > maxanisotropy )
|
if ( gl_textureanisotropylevel > maxanisotropy )
|
||||||
gl_textureanisotropylevel = maxanisotropy;
|
gl_textureanisotropylevel = maxanisotropy;
|
||||||
|
|
||||||
if ( gl_textureanisotropylevel < 1.0f )
|
if ( gl_textureanisotropylevel < 1.0f )
|
||||||
gl_textureanisotropylevel = 1.0f;
|
gl_textureanisotropylevel = 1.0f;
|
||||||
|
|
||||||
Con_Printf("Anisotropic texture filter level %.0f\n",
|
Con_Printf("Anisotropic texture filter level %.0f\n",
|
||||||
gl_textureanisotropylevel);
|
gl_textureanisotropylevel);
|
||||||
gl_texturefilteranisotropic = true;
|
gl_texturefilteranisotropic = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckTextureCompressionExtension(void)
|
void CheckTextureCompressionExtension(void)
|
||||||
{
|
{
|
||||||
if (strstr(gl_extensions, "GL_ARB_texture_compression") )
|
if (strstr(gl_extensions, "GL_ARB_texture_compression") )
|
||||||
{
|
{
|
||||||
Con_Printf("Texture compression available\n");
|
Con_Printf("Texture compression available\n");
|
||||||
gl_texcomp = true;
|
gl_texcomp = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckOcclusionTest(void)
|
void CheckOcclusionTest(void)
|
||||||
{
|
{
|
||||||
if (strstr(gl_extensions, "GL_HP_occlusion_test") )
|
if (strstr(gl_extensions, "GL_HP_occlusion_test") )
|
||||||
{
|
{
|
||||||
Con_Printf("Occlusion test available\n");
|
Con_Printf("Occlusion test available\n");
|
||||||
gl_occlusiontest = true;
|
gl_occlusiontest = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckMirrorOnce(void)
|
void CheckMirrorOnce(void)
|
||||||
{
|
{
|
||||||
if (COM_CheckParm ("-nomirroronce")) return;
|
if (COM_CheckParm ("-nomirroronce")) return;
|
||||||
|
|
||||||
if (strstr(gl_extensions, "GL_ATI_texture_mirror_once") )
|
if (strstr(gl_extensions, "GL_ATI_texture_mirror_once") )
|
||||||
{
|
{
|
||||||
Con_Printf("Mirror once available\n");
|
Con_Printf("Mirror once available\n");
|
||||||
gl_mirroronce = true;
|
gl_mirroronce = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckTwoSidedStencil(void)
|
void CheckTwoSidedStencil(void)
|
||||||
{
|
{
|
||||||
if (COM_CheckParm ("-notwosidedstencil"))
|
if (COM_CheckParm ("-notwosidedstencil"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (strstr(gl_extensions, "GL_EXT_stencil_two_side"))
|
if (strstr(gl_extensions, "GL_EXT_stencil_two_side"))
|
||||||
{
|
{
|
||||||
SAFE_GET_PROC( qglActiveStencilFaceEXT, PFNGLACTIVESTENCILFACEEXTPROC, "glActiveStencilFaceEXT");
|
SAFE_GET_PROC( qglActiveStencilFaceEXT, PFNGLACTIVESTENCILFACEEXTPROC, "glActiveStencilFaceEXT");
|
||||||
gl_twosidedstencil = 1;
|
gl_twosidedstencil = 1;
|
||||||
Con_Printf("Using EXT_stencil_two_side\n");
|
Con_Printf("Using EXT_stencil_two_side\n");
|
||||||
}
|
}
|
||||||
else if (strstr(gl_extensions, "GL_ATI_separate_stencil"))
|
else if (strstr(gl_extensions, "GL_ATI_separate_stencil"))
|
||||||
{
|
{
|
||||||
SAFE_GET_PROC( qglStencilOpSeparateATI, PFNGLSTENCILOPSEPARATEATIPROC, "glStencilOpSeparateATI");
|
SAFE_GET_PROC( qglStencilOpSeparateATI, PFNGLSTENCILOPSEPARATEATIPROC, "glStencilOpSeparateATI");
|
||||||
SAFE_GET_PROC( qglStencilFuncSeparateATI, PFNGLSTENCILFUNCSEPARATEATIPROC, "glStencilFuncSeparateATI");
|
SAFE_GET_PROC( qglStencilFuncSeparateATI, PFNGLSTENCILFUNCSEPARATEATIPROC, "glStencilFuncSeparateATI");
|
||||||
gl_twosidedstencil = 2;
|
gl_twosidedstencil = 2;
|
||||||
Con_Printf("Using ATI_separate_stencil\n");
|
Con_Printf("Using ATI_separate_stencil\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int supportedTmu;
|
static int supportedTmu;
|
||||||
/*
|
/*
|
||||||
|
@ -540,8 +540,8 @@ void GL_Init (void)
|
||||||
CheckOcclusionTest();
|
CheckOcclusionTest();
|
||||||
Con_Printf ("Checking MO\n");
|
Con_Printf ("Checking MO\n");
|
||||||
CheckMirrorOnce();
|
CheckMirrorOnce();
|
||||||
Con_Printf ("Checking two-sided stencil\n");
|
Con_Printf ("Checking two-sided stencil\n");
|
||||||
CheckTwoSidedStencil();
|
CheckTwoSidedStencil();
|
||||||
|
|
||||||
//if something goes wrong here throw an sys_error as we don't want to end up
|
//if something goes wrong here throw an sys_error as we don't want to end up
|
||||||
//having invalid function pointers called...
|
//having invalid function pointers called...
|
||||||
|
|
Loading…
Reference in a new issue