mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
Use GL_ARB_point_parameters instead of GL_EXT_point_parameters.
While here switch GL_ARB_point_parameters to a new probing logic and rename the Cvar to gl_pointparameters.
This commit is contained in:
parent
4057376993
commit
9f0b5d067b
6 changed files with 35 additions and 27 deletions
|
@ -109,8 +109,8 @@ qboolean QGL_Init ( void );
|
|||
void QGL_Shutdown ( void );
|
||||
|
||||
/* GL extensions */
|
||||
extern void ( APIENTRY *qglPointParameterfEXT ) ( GLenum param, GLfloat value );
|
||||
extern void ( APIENTRY *qglPointParameterfvEXT ) ( GLenum param,
|
||||
extern void ( APIENTRY *qglPointParameterfARB ) ( GLenum param, GLfloat value );
|
||||
extern void ( APIENTRY *qglPointParameterfvARB ) ( GLenum param,
|
||||
const GLfloat *value );
|
||||
extern void ( APIENTRY *qglColorTableEXT ) ( GLenum, GLenum, GLsizei, GLenum,
|
||||
GLenum, const GLvoid * );
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
/*
|
||||
* GL extensions
|
||||
*/
|
||||
void (APIENTRY *qglPointParameterfEXT)(GLenum param, GLfloat value);
|
||||
void (APIENTRY *qglPointParameterfvEXT)(GLenum param, const GLfloat *value);
|
||||
void (APIENTRY *qglPointParameterfARB)(GLenum param, GLfloat value);
|
||||
void (APIENTRY *qglPointParameterfvARB)(GLenum param, const GLfloat *value);
|
||||
void (APIENTRY *qglColorTableEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum,
|
||||
const GLvoid *);
|
||||
|
||||
|
@ -53,8 +53,8 @@ void ( APIENTRY *qglClientActiveTextureARB ) ( GLenum );
|
|||
|
||||
void QGL_EXT_Reset ( void )
|
||||
{
|
||||
qglPointParameterfEXT = NULL;
|
||||
qglPointParameterfvEXT = NULL;
|
||||
qglPointParameterfARB = NULL;
|
||||
qglPointParameterfvARB = NULL;
|
||||
qglColorTableEXT = NULL;
|
||||
qgl3DfxSetPaletteEXT = NULL;
|
||||
qglMultiTexCoord2fARB = NULL;
|
||||
|
|
|
@ -219,7 +219,7 @@ extern cvar_t *gl_vertex_arrays;
|
|||
extern cvar_t *gl_ext_swapinterval;
|
||||
extern cvar_t *gl_ext_palettedtexture;
|
||||
extern cvar_t *gl_ext_multitexture;
|
||||
extern cvar_t *gl_ext_pointparameters;
|
||||
extern cvar_t *gl_pointparameters;
|
||||
extern cvar_t *gl_ext_compiled_vertex_array;
|
||||
extern cvar_t *gl_ext_mtexcombine;
|
||||
|
||||
|
@ -381,6 +381,8 @@ typedef struct
|
|||
|
||||
// ----
|
||||
|
||||
qboolean pointparameters;
|
||||
|
||||
qboolean mtexcombine;
|
||||
|
||||
qboolean anisotropic;
|
||||
|
|
|
@ -98,7 +98,7 @@ cvar_t *gl_particle_att_c;
|
|||
cvar_t *gl_ext_swapinterval;
|
||||
cvar_t *gl_ext_palettedtexture;
|
||||
cvar_t *gl_ext_multitexture;
|
||||
cvar_t *gl_ext_pointparameters;
|
||||
cvar_t *gl_pointparameters;
|
||||
cvar_t *gl_ext_compiled_vertex_array;
|
||||
cvar_t *gl_ext_mtexcombine;
|
||||
|
||||
|
@ -526,7 +526,7 @@ R_DrawParticles(void)
|
|||
qboolean stereo_split_tb = ((gl_state.stereo_mode == STEREO_SPLIT_VERTICAL) && gl_state.camera_separation);
|
||||
qboolean stereo_split_lr = ((gl_state.stereo_mode == STEREO_SPLIT_HORIZONTAL) && gl_state.camera_separation);
|
||||
|
||||
if (gl_ext_pointparameters->value && qglPointParameterfEXT && !(stereo_split_tb || stereo_split_lr))
|
||||
if (gl_config.pointparameters && !(stereo_split_tb || stereo_split_lr))
|
||||
{
|
||||
int i;
|
||||
unsigned char color[4];
|
||||
|
@ -1258,7 +1258,7 @@ R_Register(void)
|
|||
gl_ext_swapinterval = Cvar_Get("gl_ext_swapinterval", "1", CVAR_ARCHIVE);
|
||||
gl_ext_palettedtexture = Cvar_Get("gl_ext_palettedtexture", "0", CVAR_ARCHIVE);
|
||||
gl_ext_multitexture = Cvar_Get("gl_ext_multitexture", "0", CVAR_ARCHIVE);
|
||||
gl_ext_pointparameters = Cvar_Get("gl_ext_pointparameters", "1", CVAR_ARCHIVE);
|
||||
gl_pointparameters = Cvar_Get("gl_pointparameters", "1", CVAR_ARCHIVE);
|
||||
gl_ext_compiled_vertex_array = Cvar_Get("gl_ext_compiled_vertex_array", "1", CVAR_ARCHIVE);
|
||||
gl_ext_mtexcombine = Cvar_Get("gl_ext_mtexcombine", "1", CVAR_ARCHIVE);
|
||||
|
||||
|
@ -1432,27 +1432,34 @@ R_Init(void *hinstance, void *hWnd)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
VID_Printf(PRINT_ALL, "\n\nProbing for OpenGL extensions:\n");
|
||||
|
||||
if (strstr(gl_config.extensions_string, "GL_EXT_point_parameters"))
|
||||
/* Point parameters */
|
||||
VID_Printf(PRINT_ALL, "- Point parameters: ");
|
||||
|
||||
if (strstr(gl_config.extensions_string, "GL_ARB_point_parameters"))
|
||||
{
|
||||
if (gl_ext_pointparameters->value)
|
||||
qglPointParameterfARB = (void (APIENTRY *)(GLenum, GLfloat))GLimp_GetProcAddress ( "glPointParameterfARB" );
|
||||
qglPointParameterfvARB = (void (APIENTRY *)(GLenum, const GLfloat *))GLimp_GetProcAddress ( "glPointParameterfvARB" );
|
||||
}
|
||||
|
||||
gl_config.pointparameters = false;
|
||||
|
||||
if (gl_pointparameters->value)
|
||||
{
|
||||
VID_Printf(PRINT_ALL, "...using GL_EXT_point_parameters\n");
|
||||
qglPointParameterfEXT = (void (APIENTRY *)(GLenum, GLfloat))
|
||||
GLimp_GetProcAddress ( "glPointParameterfEXT" );
|
||||
qglPointParameterfvEXT = (void (APIENTRY *)(GLenum, const GLfloat *))
|
||||
GLimp_GetProcAddress ( "glPointParameterfvEXT" );
|
||||
if (qglPointParameterfARB && qglPointParameterfvARB)
|
||||
{
|
||||
gl_config.pointparameters = true;
|
||||
VID_Printf(PRINT_ALL, "Okay\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
VID_Printf(PRINT_ALL, "...ignoring GL_EXT_point_parameters\n");
|
||||
VID_Printf(PRINT_ALL, "Failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VID_Printf(PRINT_ALL, "...GL_EXT_point_parameters not found\n");
|
||||
VID_Printf(PRINT_ALL, "Disabled\n");
|
||||
}
|
||||
|
||||
if (!qglColorTableEXT &&
|
||||
|
|
|
@ -198,6 +198,7 @@ R_SetDefaultState(void)
|
|||
glDisable(GL_BLEND);
|
||||
|
||||
glColor4f(1, 1, 1, 1);
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
|
@ -215,7 +216,7 @@ R_SetDefaultState(void)
|
|||
|
||||
R_TexEnv(GL_REPLACE);
|
||||
|
||||
if (qglPointParameterfEXT)
|
||||
if (gl_config.pointparameters)
|
||||
{
|
||||
float attenuations[3];
|
||||
|
||||
|
@ -228,11 +229,9 @@ R_SetDefaultState(void)
|
|||
i915.so. That the points are squares and not circles
|
||||
is not a problem by Quake II! */
|
||||
glEnable(GL_POINT_SMOOTH);
|
||||
qglPointParameterfEXT(GL_POINT_SIZE_MIN_EXT,
|
||||
gl_particle_min_size->value);
|
||||
qglPointParameterfEXT(GL_POINT_SIZE_MAX_EXT,
|
||||
gl_particle_max_size->value);
|
||||
qglPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, attenuations);
|
||||
qglPointParameterfARB(GL_POINT_SIZE_MIN_EXT, gl_particle_min_size->value);
|
||||
qglPointParameterfARB(GL_POINT_SIZE_MAX_EXT, gl_particle_max_size->value);
|
||||
qglPointParameterfvARB(GL_DISTANCE_ATTENUATION_EXT, attenuations);
|
||||
}
|
||||
|
||||
if (qglColorTableEXT && gl_ext_palettedtexture->value)
|
||||
|
|
|
@ -484,7 +484,7 @@ the most common questions are answered.
|
|||
|
||||
- Particle effects are broken. They're just squares and not perfectly
|
||||
round: This is a problem by your graphics driver, not implementing
|
||||
a special filter mode for "points". Set "gl_ext_pointparameters" to 0
|
||||
a special filter mode for "points". Set "gl_pointparameters" to 0
|
||||
to get better (but not perfect) particles.
|
||||
|
||||
- The game is bright enough but it's also washed out and dull: You need
|
||||
|
|
Loading…
Reference in a new issue