Enable more paths
This commit is contained in:
parent
df5b42137c
commit
c7b646d5b3
2 changed files with 277 additions and 281 deletions
519
gl_common.c
519
gl_common.c
|
@ -232,23 +232,23 @@ void CheckGeforce3Extensions(void)
|
|||
|
||||
void CheckVertexBufferObject(void)
|
||||
{
|
||||
if (strstr(gl_extensions, "GL_ARB_vertex_buffer_object") && (!COM_CheckParm ("-forcenovbo")) ) {
|
||||
//get VBO pointers
|
||||
SAFE_GET_PROC (qglBindBufferARB, PFNGLBINDBUFFERARBPROC, "glBindBufferARB");
|
||||
SAFE_GET_PROC (qglDeleteBuffersARB, PFNGLDELETEBUFFERSARBPROC, "glDeleteBuffersARB");
|
||||
SAFE_GET_PROC (qglGenBuffersARB, PFNGLGENBUFFERSARBPROC, "glGenBuffersARB");
|
||||
SAFE_GET_PROC (qglIsBufferARB, PFNGLISBUFFERARBPROC, "glIsBufferARB");
|
||||
SAFE_GET_PROC (qglBufferDataARB, PFNGLBUFFERDATAARBPROC, "glBufferDataARB");
|
||||
SAFE_GET_PROC (qglBufferSubDataARB, PFNGLBUFFERSUBDATAARBPROC, "glBufferSubDataARB");
|
||||
SAFE_GET_PROC (qglMapBufferARB, PFNGLMAPBUFFERARBPROC, "glMapBufferARB");
|
||||
SAFE_GET_PROC (qglUnmapBufferARB, PFNGLUNMAPBUFFERARBPROC, "glUnmapBufferARB");
|
||||
SAFE_GET_PROC (qglGetBufferParameterivARB, PFNGLGETBUFFERPARAMETERIVARBPROC, "glGetBufferParameterivARB");
|
||||
SAFE_GET_PROC (qglGetBufferPointervARB, PFNGLGETBUFFERPOINTERVARBPROC, "glGetBufferPointervARB");
|
||||
Con_Printf("Vertex buffer object available\n");
|
||||
gl_vbo = true;
|
||||
} else {
|
||||
gl_vbo = false;
|
||||
}
|
||||
if (strstr(gl_extensions, "GL_ARB_vertex_buffer_object") && (!COM_CheckParm ("-forcenovbo")) ) {
|
||||
//get VBO pointers
|
||||
SAFE_GET_PROC (qglBindBufferARB, PFNGLBINDBUFFERARBPROC, "glBindBufferARB");
|
||||
SAFE_GET_PROC (qglDeleteBuffersARB, PFNGLDELETEBUFFERSARBPROC, "glDeleteBuffersARB");
|
||||
SAFE_GET_PROC (qglGenBuffersARB, PFNGLGENBUFFERSARBPROC, "glGenBuffersARB");
|
||||
SAFE_GET_PROC (qglIsBufferARB, PFNGLISBUFFERARBPROC, "glIsBufferARB");
|
||||
SAFE_GET_PROC (qglBufferDataARB, PFNGLBUFFERDATAARBPROC, "glBufferDataARB");
|
||||
SAFE_GET_PROC (qglBufferSubDataARB, PFNGLBUFFERSUBDATAARBPROC, "glBufferSubDataARB");
|
||||
SAFE_GET_PROC (qglMapBufferARB, PFNGLMAPBUFFERARBPROC, "glMapBufferARB");
|
||||
SAFE_GET_PROC (qglUnmapBufferARB, PFNGLUNMAPBUFFERARBPROC, "glUnmapBufferARB");
|
||||
SAFE_GET_PROC (qglGetBufferParameterivARB, PFNGLGETBUFFERPARAMETERIVARBPROC, "glGetBufferParameterivARB");
|
||||
SAFE_GET_PROC (qglGetBufferPointervARB, PFNGLGETBUFFERPOINTERVARBPROC, "glGetBufferPointervARB");
|
||||
Con_Printf("Vertex buffer object available\n");
|
||||
gl_vbo = true;
|
||||
} else {
|
||||
gl_vbo = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -258,152 +258,153 @@ void CheckVertexBufferObject(void)
|
|||
|
||||
void CheckRadeonExtensions(void)
|
||||
{
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (supportedTmu >= 4) && (!COM_CheckParm ("-forcegeneric"))
|
||||
&& strstr(gl_extensions, "GL_ATI_fragment_shader")
|
||||
&& strstr(gl_extensions, "GL_EXT_vertex_shader"))
|
||||
{
|
||||
Con_Printf("Using Radeon path.\n");
|
||||
gl_cardtype = RADEON;
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (supportedTmu >= 4) && (!COM_CheckParm ("-forcegeneric"))
|
||||
&& strstr(gl_extensions, "GL_ATI_fragment_shader")
|
||||
&& strstr(gl_extensions, "GL_EXT_vertex_shader"))
|
||||
{
|
||||
Con_Printf("Using Radeon path.\n");
|
||||
gl_cardtype = RADEON;
|
||||
|
||||
//get TEX3d pointers
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
//get TEX3d pointers
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
|
||||
//default to trilinear filtering on Radeon
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
//default to trilinear filtering on Radeon
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckParheliaExtensions(void)
|
||||
{
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (supportedTmu >= 4) && (COM_CheckParm ("-forceparhelia"))
|
||||
&& strstr(gl_extensions, "GL_MTX_fragment_shader")
|
||||
&& strstr(gl_extensions, "GL_EXT_vertex_shader"))
|
||||
{
|
||||
gl_cardtype = PARHELIA;
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (supportedTmu >= 4) && (COM_CheckParm ("-forceparhelia"))
|
||||
&& strstr(gl_extensions, "GL_MTX_fragment_shader")
|
||||
&& strstr(gl_extensions, "GL_EXT_vertex_shader"))
|
||||
{
|
||||
gl_cardtype = PARHELIA;
|
||||
|
||||
//get TEX3d pointers
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
//get TEX3d pointers
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
|
||||
//default to trilinear filtering on Parhelia
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
//default to trilinear filtering on Parhelia
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CheckARBFragmentExtensions(void)
|
||||
{
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (!COM_CheckParm ("-forcegeneric"))
|
||||
&& (!COM_CheckParm ("-noarb"))
|
||||
&& strstr(gl_extensions, "GL_ARB_fragment_program")
|
||||
&& strstr(gl_extensions, "GL_ARB_vertex_program"))
|
||||
{
|
||||
gl_cardtype = ARB;
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (!COM_CheckParm ("-forcegeneric"))
|
||||
&& (!COM_CheckParm ("-noarb"))
|
||||
&& strstr(gl_extensions, "GL_ARB_fragment_program")
|
||||
&& strstr(gl_extensions, "GL_ARB_vertex_program"))
|
||||
{
|
||||
gl_cardtype = ARB;
|
||||
|
||||
//get TEX3d poiters wlgGetProcAddress
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
//get TEX3d poiters wlgGetProcAddress
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
|
||||
//default to trilinear filtering
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
//default to trilinear filtering
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckNV3xFragmentExtensions(void) {
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
void CheckNV3xFragmentExtensions(void)
|
||||
{
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (!COM_CheckParm ("-forcegeneric"))
|
||||
&& (!COM_CheckParm ("-nonv3x"))
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (!COM_CheckParm ("-forcegeneric"))
|
||||
&& (!COM_CheckParm ("-nonv3x"))
|
||||
|
||||
&& strstr(gl_extensions, "GL_NV_fragment_program")
|
||||
&& strstr(gl_extensions, "GL_NV_vertex_program2"))
|
||||
{
|
||||
gl_cardtype = NV3x;
|
||||
&& strstr(gl_extensions, "GL_NV_fragment_program")
|
||||
&& strstr(gl_extensions, "GL_NV_vertex_program2"))
|
||||
{
|
||||
gl_cardtype = NV3x;
|
||||
|
||||
//get TEX3d poiters wlgGetProcAddress
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
//get TEX3d poiters wlgGetProcAddress
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
|
||||
//get vertex_program pointers
|
||||
//get vertex_program pointers
|
||||
|
||||
SAFE_GET_PROC (qglAreProgramsResidentNV,PFNGLAREPROGRAMSRESIDENTNVPROC,"glAreProgramsResidentNV");
|
||||
SAFE_GET_PROC (qglBindProgramNV,PFNGLBINDPROGRAMNVPROC,"glBindProgramNV");
|
||||
SAFE_GET_PROC (qglDeleteProgramsNV,PFNGLDELETEPROGRAMSNVPROC,"glDeleteProgramsNV");
|
||||
SAFE_GET_PROC (qglExecuteProgramNV,PFNGLEXECUTEPROGRAMNVPROC,"glExecuteProgramNV");
|
||||
SAFE_GET_PROC (qglGenProgramsNV,PFNGLGENPROGRAMSNVPROC,"glGenProgramsNV");
|
||||
SAFE_GET_PROC (qglGetProgramParameterdvNV,PFNGLGETPROGRAMPARAMETERDVNVPROC,"glGetProgramParameterdvNV");
|
||||
SAFE_GET_PROC (qglGetProgramParameterfvNV,PFNGLGETPROGRAMPARAMETERFVNVPROC,"glGetProgramParameterfvNV");
|
||||
SAFE_GET_PROC (qglGetProgramivNV,PFNGLGETPROGRAMIVNVPROC,"glGetProgramivNV");
|
||||
SAFE_GET_PROC (qglGetProgramStringNV,PFNGLGETPROGRAMSTRINGNVPROC,"glGetProgramStringNV");
|
||||
SAFE_GET_PROC (qglGetTrackMatrixivNV,PFNGLGETTRACKMATRIXIVNVPROC,"glGetTrackMatrixivNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribdvNV,PFNGLGETVERTEXATTRIBDVNVPROC,"glGetVertexAttribdvNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribfvNV,PFNGLGETVERTEXATTRIBFVNVPROC,"glGetVertexAttribfvNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribivNV,PFNGLGETVERTEXATTRIBIVNVPROC,"glGetVertexAttribivNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribPointervNV,PFNGLGETVERTEXATTRIBPOINTERVNVPROC,"glGetVertexAttribPointervNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribPointervNV,PFNGLGETVERTEXATTRIBPOINTERVNVPROC,"glGetVertexAttribPointerNV");
|
||||
SAFE_GET_PROC (qglIsProgramNV,PFNGLISPROGRAMNVPROC,"glIsProgramNV");
|
||||
SAFE_GET_PROC (qglLoadProgramNV,PFNGLLOADPROGRAMNVPROC,"glLoadProgramNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4dNV,PFNGLPROGRAMPARAMETER4DNVPROC,"glProgramParameter4dNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4dvNV,PFNGLPROGRAMPARAMETER4DVNVPROC,"glProgramParameter4dvNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4fNV,PFNGLPROGRAMPARAMETER4FNVPROC,"glProgramParameter4fNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4fvNV,PFNGLPROGRAMPARAMETER4FVNVPROC,"glProgramParameter4fvNV");
|
||||
SAFE_GET_PROC (qglProgramParameters4dvNV,PFNGLPROGRAMPARAMETERS4DVNVPROC,"glProgramParameters4dvNV");
|
||||
SAFE_GET_PROC (qglProgramParameters4fvNV,PFNGLPROGRAMPARAMETERS4FVNVPROC,"glProgramParameters4fvNV");
|
||||
SAFE_GET_PROC (qglRequestResidentProgramsNV,PFNGLREQUESTRESIDENTPROGRAMSNVPROC,"glRequestResidentProgramsNV");
|
||||
SAFE_GET_PROC (qglTrackMatrixNV,PFNGLTRACKMATRIXNVPROC,"glTrackMatrixNV");
|
||||
SAFE_GET_PROC (qglAreProgramsResidentNV,PFNGLAREPROGRAMSRESIDENTNVPROC,"glAreProgramsResidentNV");
|
||||
SAFE_GET_PROC (qglBindProgramNV,PFNGLBINDPROGRAMNVPROC,"glBindProgramNV");
|
||||
SAFE_GET_PROC (qglDeleteProgramsNV,PFNGLDELETEPROGRAMSNVPROC,"glDeleteProgramsNV");
|
||||
SAFE_GET_PROC (qglExecuteProgramNV,PFNGLEXECUTEPROGRAMNVPROC,"glExecuteProgramNV");
|
||||
SAFE_GET_PROC (qglGenProgramsNV,PFNGLGENPROGRAMSNVPROC,"glGenProgramsNV");
|
||||
SAFE_GET_PROC (qglGetProgramParameterdvNV,PFNGLGETPROGRAMPARAMETERDVNVPROC,"glGetProgramParameterdvNV");
|
||||
SAFE_GET_PROC (qglGetProgramParameterfvNV,PFNGLGETPROGRAMPARAMETERFVNVPROC,"glGetProgramParameterfvNV");
|
||||
SAFE_GET_PROC (qglGetProgramivNV,PFNGLGETPROGRAMIVNVPROC,"glGetProgramivNV");
|
||||
SAFE_GET_PROC (qglGetProgramStringNV,PFNGLGETPROGRAMSTRINGNVPROC,"glGetProgramStringNV");
|
||||
SAFE_GET_PROC (qglGetTrackMatrixivNV,PFNGLGETTRACKMATRIXIVNVPROC,"glGetTrackMatrixivNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribdvNV,PFNGLGETVERTEXATTRIBDVNVPROC,"glGetVertexAttribdvNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribfvNV,PFNGLGETVERTEXATTRIBFVNVPROC,"glGetVertexAttribfvNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribivNV,PFNGLGETVERTEXATTRIBIVNVPROC,"glGetVertexAttribivNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribPointervNV,PFNGLGETVERTEXATTRIBPOINTERVNVPROC,"glGetVertexAttribPointervNV");
|
||||
SAFE_GET_PROC (qglGetVertexAttribPointervNV,PFNGLGETVERTEXATTRIBPOINTERVNVPROC,"glGetVertexAttribPointerNV");
|
||||
SAFE_GET_PROC (qglIsProgramNV,PFNGLISPROGRAMNVPROC,"glIsProgramNV");
|
||||
SAFE_GET_PROC (qglLoadProgramNV,PFNGLLOADPROGRAMNVPROC,"glLoadProgramNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4dNV,PFNGLPROGRAMPARAMETER4DNVPROC,"glProgramParameter4dNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4dvNV,PFNGLPROGRAMPARAMETER4DVNVPROC,"glProgramParameter4dvNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4fNV,PFNGLPROGRAMPARAMETER4FNVPROC,"glProgramParameter4fNV");
|
||||
SAFE_GET_PROC (qglProgramParameter4fvNV,PFNGLPROGRAMPARAMETER4FVNVPROC,"glProgramParameter4fvNV");
|
||||
SAFE_GET_PROC (qglProgramParameters4dvNV,PFNGLPROGRAMPARAMETERS4DVNVPROC,"glProgramParameters4dvNV");
|
||||
SAFE_GET_PROC (qglProgramParameters4fvNV,PFNGLPROGRAMPARAMETERS4FVNVPROC,"glProgramParameters4fvNV");
|
||||
SAFE_GET_PROC (qglRequestResidentProgramsNV,PFNGLREQUESTRESIDENTPROGRAMSNVPROC,"glRequestResidentProgramsNV");
|
||||
SAFE_GET_PROC (qglTrackMatrixNV,PFNGLTRACKMATRIXNVPROC,"glTrackMatrixNV");
|
||||
|
||||
//default to trilinear filtering
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
//default to trilinear filtering
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckGL2FragmentExtensions(void)
|
||||
{
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
int supportedTmu;
|
||||
glGetIntegerv(GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (!COM_CheckParm ("-forcegeneric"))
|
||||
&& (COM_CheckParm ("-gl2"))
|
||||
&& strstr(gl_extensions, "GL_ARB_shader_objects")
|
||||
&& strstr(gl_extensions, "GL_ARB_vertex_shader")
|
||||
&& strstr(gl_extensions, "GL_ARB_fragment_shader")
|
||||
&& strstr(gl_extensions, "GL_ARB_shading_language_100"))
|
||||
{
|
||||
gl_cardtype = GL2;
|
||||
if (strstr(gl_extensions, "GL_EXT_texture3D")
|
||||
&& (!COM_CheckParm ("-forcegeneric"))
|
||||
&& (COM_CheckParm ("-gl2"))
|
||||
&& strstr(gl_extensions, "GL_ARB_shader_objects")
|
||||
&& strstr(gl_extensions, "GL_ARB_vertex_shader")
|
||||
&& strstr(gl_extensions, "GL_ARB_fragment_shader")
|
||||
&& strstr(gl_extensions, "GL_ARB_shading_language_100"))
|
||||
{
|
||||
gl_cardtype = GL2;
|
||||
|
||||
//get TEX3d poiters wlgGetProcAddress
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
//get TEX3d poiters wlgGetProcAddress
|
||||
SAFE_GET_PROC (qglTexImage3DEXT,PFNGLTEXIMAGE3DEXT,"glTexImage3DEXT");
|
||||
|
||||
//default to trilinear filtering
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
//default to trilinear filtering
|
||||
gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||
gl_filter_max = GL_LINEAR;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckAnisotropicExtension(void)
|
||||
{
|
||||
if (strstr(gl_extensions, "GL_EXT_texture_filter_anisotropic") &&
|
||||
( COM_CheckParm ("-anisotropic") || COM_CheckParm ("-anisotropy")) )
|
||||
{
|
||||
GLfloat maxanisotropy;
|
||||
if (strstr(gl_extensions, "GL_EXT_texture_filter_anisotropic") &&
|
||||
( COM_CheckParm ("-anisotropic") || COM_CheckParm ("-anisotropy")) )
|
||||
{
|
||||
GLfloat maxanisotropy;
|
||||
|
||||
if ( COM_CheckParm ("-anisotropy"))
|
||||
if ( COM_CheckParm ("-anisotropy"))
|
||||
gl_textureanisotropylevel = Q_atoi(com_argv[COM_CheckParm("-anisotropy")+1]);
|
||||
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxanisotropy);
|
||||
|
@ -456,133 +457,132 @@ static int supportedTmu;
|
|||
*/
|
||||
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_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);
|
||||
|
||||
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);
|
||||
|
||||
Con_Printf ("%s %s\n", gl_renderer, gl_version);
|
||||
Con_Printf ("Checking multitexture\n");
|
||||
CheckMultiTextureExtensions ();
|
||||
|
||||
Con_Printf ("Checking multitexture\n");
|
||||
CheckMultiTextureExtensions ();
|
||||
Con_Printf ("Checking diffuse bumpmap extensions\n");
|
||||
CheckDiffuseBumpMappingExtensions ();
|
||||
|
||||
Con_Printf ("Checking diffuse bumpmap extensions\n");
|
||||
CheckDiffuseBumpMappingExtensions ();
|
||||
gl_cardtype = GENERIC;
|
||||
|
||||
gl_cardtype = GENERIC;
|
||||
Con_Printf ("Checking GL2 extensions\n");
|
||||
CheckGL2FragmentExtensions ();
|
||||
|
||||
Con_Printf ("Checking GL2 extensions\n");
|
||||
CheckGL2FragmentExtensions ();
|
||||
if ( gl_cardtype == GENERIC )
|
||||
{
|
||||
Con_Printf ("Checking NV3x extensions\n");
|
||||
CheckNV3xFragmentExtensions ();
|
||||
}
|
||||
|
||||
if ( gl_cardtype == GENERIC )
|
||||
{
|
||||
Con_Printf ("Checking NV3x extensions\n");
|
||||
CheckNV3xFragmentExtensions ();
|
||||
}
|
||||
|
||||
if ( gl_cardtype == GENERIC )
|
||||
{
|
||||
if ( gl_cardtype == GENERIC )
|
||||
{
|
||||
Con_Printf ("Checking ARB extensions\n");
|
||||
CheckARBFragmentExtensions ();
|
||||
}
|
||||
}
|
||||
|
||||
if ( gl_cardtype == GENERIC )
|
||||
{
|
||||
Con_Printf ("Checking GeForce 1/2/4-MX\n");
|
||||
CheckSpecularBumpMappingExtensions ();
|
||||
Con_Printf ("Checking GeForce 3/4\n");
|
||||
CheckGeforce3Extensions ();
|
||||
Con_Printf ("Checking Radeon 8500+\n");
|
||||
CheckRadeonExtensions ();
|
||||
Con_Printf ("Checking Parhelia\n");
|
||||
CheckParheliaExtensions ();
|
||||
}
|
||||
if ( gl_cardtype == GENERIC )
|
||||
{
|
||||
Con_Printf ("Checking GeForce 1/2/4-MX\n");
|
||||
CheckSpecularBumpMappingExtensions ();
|
||||
Con_Printf ("Checking GeForce 3/4\n");
|
||||
CheckGeforce3Extensions ();
|
||||
Con_Printf ("Checking Radeon 8500+\n");
|
||||
CheckRadeonExtensions ();
|
||||
Con_Printf ("Checking Parhelia\n");
|
||||
CheckParheliaExtensions ();
|
||||
}
|
||||
|
||||
Con_Printf ("Checking VBO\n");
|
||||
CheckVertexBufferObject();
|
||||
Con_Printf ("Checking AF\n");
|
||||
CheckAnisotropicExtension ();
|
||||
Con_Printf ("Checking TC\n");
|
||||
CheckTextureCompressionExtension ();
|
||||
Con_Printf ("Checking OT\n");
|
||||
CheckOcclusionTest();
|
||||
Con_Printf ("Checking MO\n");
|
||||
CheckMirrorOnce();
|
||||
Con_Printf ("Checking VBO\n");
|
||||
CheckVertexBufferObject();
|
||||
Con_Printf ("Checking AF\n");
|
||||
CheckAnisotropicExtension ();
|
||||
Con_Printf ("Checking TC\n");
|
||||
CheckTextureCompressionExtension ();
|
||||
Con_Printf ("Checking OT\n");
|
||||
CheckOcclusionTest();
|
||||
Con_Printf ("Checking MO\n");
|
||||
CheckMirrorOnce();
|
||||
|
||||
//if something goes wrong here throw an sys_error as we don't want to end up
|
||||
//having invalid function pointers called...
|
||||
switch (gl_cardtype)
|
||||
{
|
||||
/*case GENERIC:
|
||||
Con_Printf ("Using generic path.\n");
|
||||
// Sys_Error("No generic path yet\n");
|
||||
BUMP_InitGeneric();
|
||||
break;
|
||||
case GEFORCE:
|
||||
Con_Printf ("Using GeForce 1/2/4-MX path\n");
|
||||
// Sys_Error("No geforce2 path yet\n");
|
||||
BUMP_InitGeneric(); // has optimizations for GF cards (some day :)
|
||||
break;
|
||||
case GEFORCE3:
|
||||
Con_Printf ("Using GeForce 3/4 path\n");
|
||||
BUMP_InitGeforce3();
|
||||
break;
|
||||
case RADEON:
|
||||
Con_Printf ("Using Radeon path.\n");
|
||||
BUMP_InitRadeon();
|
||||
break;
|
||||
case PARHELIA:
|
||||
Con_Printf ("Using Parhelia path.\n");
|
||||
BUMP_InitParhelia();
|
||||
break;*/
|
||||
case ARB:
|
||||
Con_Printf ("Using ARB_fragment_program path.\n");
|
||||
BUMP_InitARB();
|
||||
break;
|
||||
/*case NV3x:
|
||||
Con_Printf ("Using NV_fragment_program path.\n");
|
||||
BUMP_InitNV3x();
|
||||
break;
|
||||
case GL2:
|
||||
Con_Printf ("Using GL2 path.\n");
|
||||
BUMP_InitGL2();
|
||||
break;*/
|
||||
}
|
||||
//if something goes wrong here throw an sys_error as we don't want to end up
|
||||
//having invalid function pointers called...
|
||||
switch (gl_cardtype)
|
||||
{
|
||||
case GENERIC:
|
||||
Con_Printf ("Using generic path.\n");
|
||||
Sys_Error("No working generic path yet\n");
|
||||
// BUMP_InitGeneric();
|
||||
break;
|
||||
case GEFORCE:
|
||||
Con_Printf ("Using GeForce 1/2/4-MX path\n");
|
||||
Sys_Error("No working geforce2 path yet\n");
|
||||
// BUMP_InitGeneric(); // has optimizations for GF cards (some day :)
|
||||
break;
|
||||
case GEFORCE3:
|
||||
Con_Printf ("Using GeForce 3/4 path\n");
|
||||
BUMP_InitGeforce3();
|
||||
break;
|
||||
case RADEON:
|
||||
Con_Printf ("Using Radeon path.\n");
|
||||
BUMP_InitRadeon();
|
||||
break;
|
||||
case PARHELIA:
|
||||
Con_Printf ("Using Parhelia path.\n");
|
||||
BUMP_InitParhelia();
|
||||
break;
|
||||
case ARB:
|
||||
Con_Printf ("Using ARB_fragment_program path.\n");
|
||||
BUMP_InitARB();
|
||||
break;
|
||||
case NV3x:
|
||||
Con_Printf ("Using NV_fragment_program path.\n");
|
||||
BUMP_InitNV3x();
|
||||
break;
|
||||
case GL2:
|
||||
Con_Printf ("Using GL2 path.\n");
|
||||
BUMP_InitGL2();
|
||||
break;
|
||||
}
|
||||
|
||||
GL_InitDriverMem();
|
||||
GL_InitVertexCache();
|
||||
GL_InitDriverMem();
|
||||
GL_InitVertexCache();
|
||||
|
||||
glGetIntegerv (GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
Con_Printf ("%i texture units\n",supportedTmu);
|
||||
glGetIntegerv (GL_MAX_ACTIVE_TEXTURES_ARB,&supportedTmu);
|
||||
Con_Printf ("%i texture units\n",supportedTmu);
|
||||
|
||||
//PENTA: enable mlook by default, people kept mailing me about how to do mlook
|
||||
Cbuf_AddText ("+mlook\n");
|
||||
//PENTA: enable mlook by default, people kept mailing me about how to do mlook
|
||||
Cbuf_AddText ("+mlook\n");
|
||||
|
||||
glClearColor (0.5,0.5,0.5,0.5);
|
||||
glCullFace (GL_FRONT);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
glClearColor (0.5,0.5,0.5,0.5);
|
||||
glCullFace (GL_FRONT);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
|
||||
glEnable (GL_ALPHA_TEST);
|
||||
glAlphaFunc (GL_GREATER, 0.666f);
|
||||
glEnable (GL_ALPHA_TEST);
|
||||
glAlphaFunc (GL_GREATER, 0.666f);
|
||||
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
||||
glShadeModel (GL_FLAT);
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
||||
glShadeModel (GL_FLAT);
|
||||
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
//glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
//glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
}
|
||||
|
||||
extern qboolean mtexenabled;
|
||||
|
@ -591,39 +591,40 @@ extern qboolean mtexenabled;
|
|||
To get rid of state changes once and for all
|
||||
Don't call this too often tough...
|
||||
*/
|
||||
void GL_SetupDefaultState(void) {
|
||||
int i;
|
||||
void GL_SetupDefaultState(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
for (i=1; i<supportedTmu; i++) {
|
||||
glLoadIdentity();
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB+i);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
for (i=1; i<supportedTmu; i++) {
|
||||
glLoadIdentity();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
mtexenabled = false;
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB+i);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
}
|
||||
|
||||
if (gl_cardtype == ARB) {
|
||||
//glDisable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
//glDisable(GL_VERTEX_PROGRAM_ARB);
|
||||
}
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
glLoadIdentity();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
mtexenabled = false;
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace (GL_FRONT);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glAlphaFunc (GL_GREATER, 0.666f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
|
||||
if (gl_cardtype == ARB) {
|
||||
//glDisable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
//glDisable(GL_VERTEX_PROGRAM_ARB);
|
||||
}
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace (GL_FRONT);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glAlphaFunc (GL_GREATER, 0.666f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
|
@ -232,8 +232,7 @@
|
|||
<File
|
||||
RelativePath="..\gl_bumpgf.c">
|
||||
<FileConfiguration
|
||||
Name="GL Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
Name="GL Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
|
@ -247,8 +246,7 @@
|
|||
<File
|
||||
RelativePath="..\gl_bumpgl2.c">
|
||||
<FileConfiguration
|
||||
Name="GL Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
Name="GL Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
|
@ -265,8 +263,7 @@
|
|||
<File
|
||||
RelativePath="..\gl_bumpnv3x.c">
|
||||
<FileConfiguration
|
||||
Name="GL Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
Name="GL Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
|
@ -280,8 +277,7 @@
|
|||
<File
|
||||
RelativePath="..\gl_bumpparhelia.c">
|
||||
<FileConfiguration
|
||||
Name="GL Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
Name="GL Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
|
@ -295,8 +291,7 @@
|
|||
<File
|
||||
RelativePath="..\gl_bumpradeon.c">
|
||||
<FileConfiguration
|
||||
Name="GL Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
Name="GL Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
|
|
Loading…
Reference in a new issue