mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
More GL_Init_Common() cleanup.
Move the call to GL_Common_Init_Cvars() out of the block of check calls.
This commit is contained in:
parent
51aaee5c3b
commit
f6ebb78140
1 changed files with 18 additions and 7 deletions
|
@ -80,6 +80,7 @@ VISIBLE int gl_release_number;
|
||||||
static int gl_bgra_capable;
|
static int gl_bgra_capable;
|
||||||
VISIBLE int use_bgra;
|
VISIBLE int use_bgra;
|
||||||
VISIBLE int gl_va_capable;
|
VISIBLE int gl_va_capable;
|
||||||
|
static int driver_vaelements;
|
||||||
VISIBLE int vaelements;
|
VISIBLE int vaelements;
|
||||||
VISIBLE int texture_extension_number = 1;
|
VISIBLE int texture_extension_number = 1;
|
||||||
VISIBLE int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
VISIBLE int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
|
||||||
|
@ -273,6 +274,15 @@ gl_tessellate_f (cvar_t * var)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gl_vaelements_max_f (cvar_t *var)
|
||||||
|
{
|
||||||
|
if (var->int_val)
|
||||||
|
vaelements = min (var->int_val, driver_vaelements);
|
||||||
|
else
|
||||||
|
vaelements = driver_vaelements;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
GL_Common_Init_Cvars (void)
|
GL_Common_Init_Cvars (void)
|
||||||
{
|
{
|
||||||
|
@ -305,7 +315,8 @@ GL_Common_Init_Cvars (void)
|
||||||
Cvar_Get ("gl_tessellate", "0", CVAR_NONE, gl_tessellate_f,
|
Cvar_Get ("gl_tessellate", "0", CVAR_NONE, gl_tessellate_f,
|
||||||
nva ("Specifies tessellation level from 0 to %i. Higher "
|
nva ("Specifies tessellation level from 0 to %i. Higher "
|
||||||
"tessellation level means more triangles.", tess_max));
|
"tessellation level means more triangles.", tess_max));
|
||||||
gl_vaelements_max = Cvar_Get ("gl_vaelements_max", "0", CVAR_ROM, NULL,
|
gl_vaelements_max = Cvar_Get ("gl_vaelements_max", "0", CVAR_ROM,
|
||||||
|
gl_vaelements_max_f,
|
||||||
"Limit the vertex array size for buggy "
|
"Limit the vertex array size for buggy "
|
||||||
"drivers. 0 (default) uses driver provided "
|
"drivers. 0 (default) uses driver provided "
|
||||||
"limit, -1 disables use of vertex arrays.");
|
"limit, -1 disables use of vertex arrays.");
|
||||||
|
@ -471,11 +482,10 @@ CheckTruFormExtensions (void)
|
||||||
static void
|
static void
|
||||||
CheckVertexArraySize (void)
|
CheckVertexArraySize (void)
|
||||||
{
|
{
|
||||||
qfglGetIntegerv (GL_MAX_ELEMENTS_VERTICES, &vaelements);
|
qfglGetIntegerv (GL_MAX_ELEMENTS_VERTICES, &driver_vaelements);
|
||||||
if (vaelements > 65536)
|
if (driver_vaelements > 65536)
|
||||||
vaelements = 65536;
|
driver_vaelements = 65536;
|
||||||
if (gl_vaelements_max->int_val)
|
vaelements = driver_vaelements;
|
||||||
vaelements = min (gl_vaelements_max->int_val, vaelements);
|
|
||||||
// qfglGetIntegerv (MAX_ELEMENTS_INDICES, *vaindices);
|
// qfglGetIntegerv (MAX_ELEMENTS_INDICES, *vaindices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,10 +607,11 @@ GL_Init_Common (void)
|
||||||
CheckCombineExtensions ();
|
CheckCombineExtensions ();
|
||||||
CheckBGRAExtensions ();
|
CheckBGRAExtensions ();
|
||||||
CheckTruFormExtensions ();
|
CheckTruFormExtensions ();
|
||||||
GL_Common_Init_Cvars ();
|
|
||||||
CheckVertexArraySize ();
|
CheckVertexArraySize ();
|
||||||
CheckLights ();
|
CheckLights ();
|
||||||
|
|
||||||
|
GL_Common_Init_Cvars ();
|
||||||
|
|
||||||
qfglClearColor (0, 0, 0, 0);
|
qfglClearColor (0, 0, 0, 0);
|
||||||
|
|
||||||
qfglEnable (GL_TEXTURE_2D);
|
qfglEnable (GL_TEXTURE_2D);
|
||||||
|
|
Loading…
Reference in a new issue