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:
Yamagi Burmeister 2016-08-06 09:50:16 +02:00
parent 4057376993
commit 9f0b5d067b
6 changed files with 35 additions and 27 deletions

View file

@ -109,8 +109,8 @@ qboolean QGL_Init ( void );
void QGL_Shutdown ( void ); void QGL_Shutdown ( void );
/* GL extensions */ /* GL extensions */
extern void ( APIENTRY *qglPointParameterfEXT ) ( GLenum param, GLfloat value ); extern void ( APIENTRY *qglPointParameterfARB ) ( GLenum param, GLfloat value );
extern void ( APIENTRY *qglPointParameterfvEXT ) ( GLenum param, extern void ( APIENTRY *qglPointParameterfvARB ) ( GLenum param,
const GLfloat *value ); const GLfloat *value );
extern void ( APIENTRY *qglColorTableEXT ) ( GLenum, GLenum, GLsizei, GLenum, extern void ( APIENTRY *qglColorTableEXT ) ( GLenum, GLenum, GLsizei, GLenum,
GLenum, const GLvoid * ); GLenum, const GLvoid * );

View file

@ -38,8 +38,8 @@
/* /*
* GL extensions * GL extensions
*/ */
void (APIENTRY *qglPointParameterfEXT)(GLenum param, GLfloat value); void (APIENTRY *qglPointParameterfARB)(GLenum param, GLfloat value);
void (APIENTRY *qglPointParameterfvEXT)(GLenum param, const GLfloat *value); void (APIENTRY *qglPointParameterfvARB)(GLenum param, const GLfloat *value);
void (APIENTRY *qglColorTableEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum, void (APIENTRY *qglColorTableEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum,
const GLvoid *); const GLvoid *);
@ -53,8 +53,8 @@ void ( APIENTRY *qglClientActiveTextureARB ) ( GLenum );
void QGL_EXT_Reset ( void ) void QGL_EXT_Reset ( void )
{ {
qglPointParameterfEXT = NULL; qglPointParameterfARB = NULL;
qglPointParameterfvEXT = NULL; qglPointParameterfvARB = NULL;
qglColorTableEXT = NULL; qglColorTableEXT = NULL;
qgl3DfxSetPaletteEXT = NULL; qgl3DfxSetPaletteEXT = NULL;
qglMultiTexCoord2fARB = NULL; qglMultiTexCoord2fARB = NULL;

View file

@ -219,7 +219,7 @@ extern cvar_t *gl_vertex_arrays;
extern cvar_t *gl_ext_swapinterval; extern cvar_t *gl_ext_swapinterval;
extern cvar_t *gl_ext_palettedtexture; extern cvar_t *gl_ext_palettedtexture;
extern cvar_t *gl_ext_multitexture; 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_compiled_vertex_array;
extern cvar_t *gl_ext_mtexcombine; extern cvar_t *gl_ext_mtexcombine;
@ -381,6 +381,8 @@ typedef struct
// ---- // ----
qboolean pointparameters;
qboolean mtexcombine; qboolean mtexcombine;
qboolean anisotropic; qboolean anisotropic;

View file

@ -98,7 +98,7 @@ cvar_t *gl_particle_att_c;
cvar_t *gl_ext_swapinterval; cvar_t *gl_ext_swapinterval;
cvar_t *gl_ext_palettedtexture; cvar_t *gl_ext_palettedtexture;
cvar_t *gl_ext_multitexture; 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_compiled_vertex_array;
cvar_t *gl_ext_mtexcombine; 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_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); 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; int i;
unsigned char color[4]; unsigned char color[4];
@ -1258,7 +1258,7 @@ R_Register(void)
gl_ext_swapinterval = Cvar_Get("gl_ext_swapinterval", "1", CVAR_ARCHIVE); gl_ext_swapinterval = Cvar_Get("gl_ext_swapinterval", "1", CVAR_ARCHIVE);
gl_ext_palettedtexture = Cvar_Get("gl_ext_palettedtexture", "0", 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_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_compiled_vertex_array = Cvar_Get("gl_ext_compiled_vertex_array", "1", CVAR_ARCHIVE);
gl_ext_mtexcombine = Cvar_Get("gl_ext_mtexcombine", "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"); 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"); if (qglPointParameterfARB && qglPointParameterfvARB)
qglPointParameterfEXT = (void (APIENTRY *)(GLenum, GLfloat)) {
GLimp_GetProcAddress ( "glPointParameterfEXT" ); gl_config.pointparameters = true;
qglPointParameterfvEXT = (void (APIENTRY *)(GLenum, const GLfloat *)) VID_Printf(PRINT_ALL, "Okay\n");
GLimp_GetProcAddress ( "glPointParameterfvEXT" );
} }
else else
{ {
VID_Printf(PRINT_ALL, "...ignoring GL_EXT_point_parameters\n"); VID_Printf(PRINT_ALL, "Failed\n");
} }
} }
else else
{ {
VID_Printf(PRINT_ALL, "...GL_EXT_point_parameters not found\n"); VID_Printf(PRINT_ALL, "Disabled\n");
} }
if (!qglColorTableEXT && if (!qglColorTableEXT &&

View file

@ -198,6 +198,7 @@ R_SetDefaultState(void)
glDisable(GL_BLEND); glDisable(GL_BLEND);
glColor4f(1, 1, 1, 1); glColor4f(1, 1, 1, 1);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glShadeModel(GL_FLAT); glShadeModel(GL_FLAT);
@ -215,7 +216,7 @@ R_SetDefaultState(void)
R_TexEnv(GL_REPLACE); R_TexEnv(GL_REPLACE);
if (qglPointParameterfEXT) if (gl_config.pointparameters)
{ {
float attenuations[3]; float attenuations[3];
@ -228,11 +229,9 @@ R_SetDefaultState(void)
i915.so. That the points are squares and not circles i915.so. That the points are squares and not circles
is not a problem by Quake II! */ is not a problem by Quake II! */
glEnable(GL_POINT_SMOOTH); glEnable(GL_POINT_SMOOTH);
qglPointParameterfEXT(GL_POINT_SIZE_MIN_EXT, qglPointParameterfARB(GL_POINT_SIZE_MIN_EXT, gl_particle_min_size->value);
gl_particle_min_size->value); qglPointParameterfARB(GL_POINT_SIZE_MAX_EXT, gl_particle_max_size->value);
qglPointParameterfEXT(GL_POINT_SIZE_MAX_EXT, qglPointParameterfvARB(GL_DISTANCE_ATTENUATION_EXT, attenuations);
gl_particle_max_size->value);
qglPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, attenuations);
} }
if (qglColorTableEXT && gl_ext_palettedtexture->value) if (qglColorTableEXT && gl_ext_palettedtexture->value)

View file

@ -484,7 +484,7 @@ the most common questions are answered.
- Particle effects are broken. They're just squares and not perfectly - Particle effects are broken. They're just squares and not perfectly
round: This is a problem by your graphics driver, not implementing 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. to get better (but not perfect) particles.
- The game is bright enough but it's also washed out and dull: You need - The game is bright enough but it's also washed out and dull: You need