mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-22 03:41:19 +00:00
Merge commit '3faa3db1'
Partial merge of https://github.com/yquake2/yquake2/pull/1103
This commit is contained in:
commit
d3239738e9
8 changed files with 258 additions and 114 deletions
|
@ -144,6 +144,30 @@ R_SetTexturePalette(const unsigned palette[256])
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
R_SelectTexture(GLenum texture)
|
||||
{
|
||||
int tmu;
|
||||
|
||||
if (!gl_config.multitexture)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
tmu = texture - GL_TEXTURE0;
|
||||
|
||||
if (tmu == gl_state.currenttmu)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gl_state.currenttmu = tmu;
|
||||
gl_state.currenttarget = texture;
|
||||
|
||||
qglActiveTexture(texture);
|
||||
qglClientActiveTexture(texture);
|
||||
}
|
||||
|
||||
void
|
||||
R_TexEnv(GLenum mode)
|
||||
{
|
||||
|
@ -151,7 +175,7 @@ R_TexEnv(GLenum mode)
|
|||
|
||||
if (mode != lastmodes[gl_state.currenttmu])
|
||||
{
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode); // FIXME: shouldn't this be glTexEnvi() ?
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode);
|
||||
lastmodes[gl_state.currenttmu] = mode;
|
||||
}
|
||||
}
|
||||
|
@ -175,6 +199,93 @@ R_Bind(int texnum)
|
|||
glBindTexture(GL_TEXTURE_2D, texnum);
|
||||
}
|
||||
|
||||
void
|
||||
R_MBind(GLenum target, int texnum)
|
||||
{
|
||||
const int tmu = target - GL_TEXTURE0;
|
||||
|
||||
if (target != gl_state.currenttarget)
|
||||
{
|
||||
R_SelectTexture(target);
|
||||
}
|
||||
|
||||
if (gl_state.currenttextures[tmu] == texnum)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
R_Bind(texnum);
|
||||
}
|
||||
|
||||
void
|
||||
R_EnableMultitexture(qboolean enable)
|
||||
{
|
||||
static qboolean active;
|
||||
|
||||
if (!gl_config.multitexture || enable == active)
|
||||
{
|
||||
return; // current state is the right one
|
||||
}
|
||||
|
||||
active = enable;
|
||||
R_SelectTexture(GL_TEXTURE1);
|
||||
|
||||
if (active && !r_fullbright->value)
|
||||
{
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
if (gl_config.mtexcombine)
|
||||
{
|
||||
R_TexEnv(GL_COMBINE);
|
||||
|
||||
if (gl_lightmap->value)
|
||||
{
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE);
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_PREVIOUS);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, GL_PREVIOUS);
|
||||
}
|
||||
|
||||
R_SelectTexture(GL_TEXTURE0);
|
||||
R_TexEnv(GL_COMBINE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gl_lightmap->value)
|
||||
{
|
||||
R_TexEnv(GL_REPLACE);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_TexEnv(GL_MODULATE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else // disable multitexturing
|
||||
{
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
R_TexEnv(GL_REPLACE);
|
||||
}
|
||||
|
||||
R_SelectTexture(GL_TEXTURE0);
|
||||
R_TexEnv(GL_REPLACE);
|
||||
}
|
||||
|
||||
void
|
||||
R_TextureMode(const char *string)
|
||||
{
|
||||
|
|
|
@ -91,6 +91,7 @@ cvar_t *gl1_particle_square;
|
|||
|
||||
cvar_t *gl1_palettedtexture;
|
||||
cvar_t *gl1_pointparameters;
|
||||
cvar_t *gl1_multitexture;
|
||||
|
||||
cvar_t *gl_drawbuffer;
|
||||
cvar_t *gl_lightmap;
|
||||
|
@ -1225,6 +1226,7 @@ R_Register(void)
|
|||
|
||||
gl1_palettedtexture = ri.Cvar_Get("r_palettedtextures", "0", CVAR_ARCHIVE);
|
||||
gl1_pointparameters = ri.Cvar_Get("gl1_pointparameters", "1", CVAR_ARCHIVE);
|
||||
gl1_multitexture = ri.Cvar_Get("gl1_multitexture", "2", CVAR_ARCHIVE);
|
||||
|
||||
gl_drawbuffer = ri.Cvar_Get("gl_drawbuffer", "GL_BACK", 0);
|
||||
r_vsync = ri.Cvar_Get("r_vsync", "1", CVAR_ARCHIVE);
|
||||
|
@ -1483,17 +1485,29 @@ RI_Init(void)
|
|||
/* Point parameters */
|
||||
R_Printf(PRINT_ALL, " - Point parameters: ");
|
||||
|
||||
if (strstr(gl_config.extensions_string, "GL_ARB_point_parameters"))
|
||||
if ( strstr(gl_config.extensions_string, "GL_ARB_point_parameters") ||
|
||||
strstr(gl_config.extensions_string, "GL_EXT_point_parameters") ) // should exist for all OGL 1.4 hw...
|
||||
{
|
||||
qglPointParameterfARB = (void (APIENTRY *)(GLenum, GLfloat))RI_GetProcAddress ( "glPointParameterfARB" );
|
||||
qglPointParameterfvARB = (void (APIENTRY *)(GLenum, const GLfloat *))RI_GetProcAddress ( "glPointParameterfvARB" );
|
||||
qglPointParameterf = (void (APIENTRY *)(GLenum, GLfloat))RI_GetProcAddress ( "glPointParameterf" );
|
||||
qglPointParameterfv = (void (APIENTRY *)(GLenum, const GLfloat *))RI_GetProcAddress ( "glPointParameterfv" );
|
||||
|
||||
if (!qglPointParameterf || !qglPointParameterfv)
|
||||
{
|
||||
qglPointParameterf = (void (APIENTRY *)(GLenum, GLfloat))RI_GetProcAddress ( "glPointParameterfARB" );
|
||||
qglPointParameterfv = (void (APIENTRY *)(GLenum, const GLfloat *))RI_GetProcAddress ( "glPointParameterfvARB" );
|
||||
}
|
||||
if (!qglPointParameterf || !qglPointParameterfv)
|
||||
{
|
||||
qglPointParameterf = (void (APIENTRY *)(GLenum, GLfloat))RI_GetProcAddress ( "glPointParameterfEXT" );
|
||||
qglPointParameterfv = (void (APIENTRY *)(GLenum, const GLfloat *))RI_GetProcAddress ( "glPointParameterfvEXT" );
|
||||
}
|
||||
}
|
||||
|
||||
gl_config.pointparameters = false;
|
||||
|
||||
if (gl1_pointparameters->value)
|
||||
{
|
||||
if (qglPointParameterfARB && qglPointParameterfvARB)
|
||||
if (qglPointParameterf && qglPointParameterfv)
|
||||
{
|
||||
gl_config.pointparameters = true;
|
||||
R_Printf(PRINT_ALL, "Okay\n");
|
||||
|
@ -1577,6 +1591,65 @@ RI_Init(void)
|
|||
|
||||
// ----
|
||||
|
||||
/* Multitexturing */
|
||||
gl_config.multitexture = gl_config.mtexcombine = false;
|
||||
|
||||
R_Printf(PRINT_ALL, " - Multitexturing: ");
|
||||
|
||||
if (strstr(gl_config.extensions_string, "GL_ARB_multitexture"))
|
||||
{
|
||||
qglActiveTexture = (void (APIENTRY *)(GLenum))RI_GetProcAddress ("glActiveTexture");
|
||||
qglClientActiveTexture = (void (APIENTRY *)(GLenum))RI_GetProcAddress ("glClientActiveTexture");
|
||||
|
||||
if (!qglActiveTexture || !qglClientActiveTexture)
|
||||
{
|
||||
qglActiveTexture = (void (APIENTRY *)(GLenum))RI_GetProcAddress ("glActiveTextureARB");
|
||||
qglClientActiveTexture = (void (APIENTRY *)(GLenum))RI_GetProcAddress ("glClientActiveTextureARB");
|
||||
}
|
||||
}
|
||||
|
||||
if (gl1_multitexture->value)
|
||||
{
|
||||
if (qglActiveTexture && qglClientActiveTexture)
|
||||
{
|
||||
gl_config.multitexture = true;
|
||||
R_Printf(PRINT_ALL, "Okay\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Disabled\n");
|
||||
}
|
||||
|
||||
// ----
|
||||
|
||||
/* Multi texturing combine */
|
||||
R_Printf(PRINT_ALL, " - Multitexturing combine: ");
|
||||
|
||||
if ( ( strstr(gl_config.extensions_string, "GL_ARB_texture_env_combine")
|
||||
|| strstr(gl_config.extensions_string, "GL_EXT_texture_env_combine") ) )
|
||||
{
|
||||
if (gl_config.multitexture && gl1_multitexture->value > 1)
|
||||
{
|
||||
gl_config.mtexcombine = true;
|
||||
R_Printf(PRINT_ALL, "Okay\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Disabled\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Failed\n");
|
||||
}
|
||||
|
||||
// ----
|
||||
|
||||
R_SetDefaultState();
|
||||
|
||||
R_VertBufferInit();
|
||||
|
|
|
@ -208,9 +208,9 @@ R_SetDefaultState(void)
|
|||
attenuations[1] = gl1_particle_att_b->value;
|
||||
attenuations[2] = gl1_particle_att_c->value;
|
||||
|
||||
qglPointParameterfARB(GL_POINT_SIZE_MIN_EXT, gl1_particle_min_size->value);
|
||||
qglPointParameterfARB(GL_POINT_SIZE_MAX_EXT, gl1_particle_max_size->value);
|
||||
qglPointParameterfvARB(GL_DISTANCE_ATTENUATION_EXT, attenuations);
|
||||
qglPointParameterf(GL_POINT_SIZE_MIN, gl1_particle_min_size->value);
|
||||
qglPointParameterf(GL_POINT_SIZE_MAX, gl1_particle_max_size->value);
|
||||
qglPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, attenuations);
|
||||
|
||||
/* GL_POINT_SMOOTH is not implemented by some OpenGL
|
||||
drivers, especially the crappy Mesa3D backends like
|
||||
|
|
|
@ -33,12 +33,6 @@
|
|||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
static SDL_Window* window = NULL;
|
||||
static SDL_GLContext context = NULL;
|
||||
qboolean IsHighDPIaware = false;
|
||||
|
|
|
@ -281,8 +281,8 @@ R_BlendLightmaps(const model_t *currentmodel)
|
|||
// Apply overbright bits to the static lightmaps
|
||||
if (gl1_overbrightbits->value)
|
||||
{
|
||||
R_TexEnv(GL_COMBINE_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, gl1_overbrightbits->value);
|
||||
R_TexEnv(GL_COMBINE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, gl1_overbrightbits->value);
|
||||
}
|
||||
|
||||
R_DrawGLPolyChain(surf->polys, 0, 0);
|
||||
|
@ -344,8 +344,8 @@ R_BlendLightmaps(const model_t *currentmodel)
|
|||
// Apply overbright bits to the dynamic lightmaps
|
||||
if (gl1_overbrightbits->value)
|
||||
{
|
||||
R_TexEnv(GL_COMBINE_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, gl1_overbrightbits->value);
|
||||
R_TexEnv(GL_COMBINE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, gl1_overbrightbits->value);
|
||||
}
|
||||
|
||||
R_DrawGLPolyChain(drawsurf->polys,
|
||||
|
@ -390,8 +390,8 @@ R_BlendLightmaps(const model_t *currentmodel)
|
|||
// Apply overbright bits to the remainder lightmaps
|
||||
if (gl1_overbrightbits->value)
|
||||
{
|
||||
R_TexEnv(GL_COMBINE_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, gl1_overbrightbits->value);
|
||||
R_TexEnv(GL_COMBINE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, gl1_overbrightbits->value);
|
||||
}
|
||||
|
||||
R_DrawGLPolyChain(surf->polys,
|
||||
|
@ -411,17 +411,12 @@ static void
|
|||
R_RenderBrushPoly(const entity_t *currententity, msurface_t *fa)
|
||||
{
|
||||
qboolean is_dynamic = false;
|
||||
const image_t *image;
|
||||
int maps;
|
||||
|
||||
c_brush_polys++;
|
||||
|
||||
image = R_TextureAnimation(currententity, fa->texinfo);
|
||||
|
||||
if (fa->flags & SURF_DRAWTURB)
|
||||
{
|
||||
R_Bind(image->texnum);
|
||||
|
||||
/* This is a hack ontop of a hack. Warping surfaces like those generated
|
||||
by R_EmitWaterPolys() don't have a lightmap. Original Quake II therefore
|
||||
negated the global intensity on those surfaces, because otherwise they
|
||||
|
@ -437,8 +432,8 @@ R_RenderBrushPoly(const entity_t *currententity, msurface_t *fa)
|
|||
They oversaturate otherwise. */
|
||||
if (gl1_overbrightbits->value)
|
||||
{
|
||||
R_TexEnv(GL_COMBINE_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1);
|
||||
R_TexEnv(GL_COMBINE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -452,12 +447,8 @@ R_RenderBrushPoly(const entity_t *currententity, msurface_t *fa)
|
|||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Bind(image->texnum);
|
||||
|
||||
R_TexEnv(GL_REPLACE);
|
||||
}
|
||||
R_TexEnv(GL_REPLACE);
|
||||
|
||||
if (fa->texinfo->flags & SURF_SCROLL)
|
||||
{
|
||||
|
@ -622,6 +613,7 @@ R_DrawTextureChains(const entity_t *currententity)
|
|||
|
||||
for ( ; s; s = s->texturechain)
|
||||
{
|
||||
R_Bind(image->texnum); // may reset because of dynamic lighting in R_RenderBrushPoly
|
||||
R_RenderBrushPoly(currententity, s);
|
||||
}
|
||||
|
||||
|
@ -636,6 +628,7 @@ R_DrawInlineBModel(const entity_t *currententity, const model_t *currentmodel)
|
|||
{
|
||||
int i;
|
||||
msurface_t *psurf;
|
||||
image_t *image;
|
||||
|
||||
/* calculate dynamic lighting for bmodel */
|
||||
if (!r_flashblend->value)
|
||||
|
@ -676,6 +669,8 @@ R_DrawInlineBModel(const entity_t *currententity, const model_t *currentmodel)
|
|||
}
|
||||
else
|
||||
{
|
||||
image = R_TextureAnimation(currententity, psurf->texinfo);
|
||||
R_Bind(image->texnum);
|
||||
R_RenderBrushPoly(currententity, psurf);
|
||||
}
|
||||
}
|
||||
|
@ -683,7 +678,6 @@ R_DrawInlineBModel(const entity_t *currententity, const model_t *currentmodel)
|
|||
|
||||
if (!(currententity->flags & RF_TRANSLUCENT))
|
||||
{
|
||||
|
||||
R_BlendLightmaps(currentmodel);
|
||||
}
|
||||
else
|
||||
|
@ -760,8 +754,6 @@ R_DrawBrushModel(entity_t *currententity, const model_t *currentmodel)
|
|||
currententity->angles[0] = -currententity->angles[0];
|
||||
currententity->angles[2] = -currententity->angles[2];
|
||||
|
||||
R_TexEnv(GL_REPLACE);
|
||||
|
||||
if (gl_lightmap->value)
|
||||
{
|
||||
R_TexEnv(GL_REPLACE);
|
||||
|
@ -917,7 +909,6 @@ void
|
|||
R_DrawWorld(void)
|
||||
{
|
||||
entity_t ent;
|
||||
const model_t *currentmodel;
|
||||
|
||||
if (!r_drawworld->value)
|
||||
{
|
||||
|
@ -929,8 +920,6 @@ R_DrawWorld(void)
|
|||
return;
|
||||
}
|
||||
|
||||
currentmodel = r_worldmodel;
|
||||
|
||||
VectorCopy(r_newrefdef.vieworg, modelorg);
|
||||
|
||||
/* auto cycle the world frame for texture animation */
|
||||
|
@ -945,7 +934,7 @@ R_DrawWorld(void)
|
|||
RE_ClearSkyBox();
|
||||
R_RecursiveWorldNode(&ent, r_worldmodel->nodes);
|
||||
R_DrawTextureChains(&ent);
|
||||
R_BlendLightmaps(currentmodel);
|
||||
R_BlendLightmaps(r_worldmodel);
|
||||
R_DrawSkyBox();
|
||||
R_DrawTriangleOutlines();
|
||||
}
|
||||
|
@ -1048,4 +1037,3 @@ R_MarkLeaves(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,24 +39,6 @@
|
|||
#define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_3
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#endif
|
||||
|
||||
#ifndef GL_MULTISAMPLE
|
||||
#define GL_MULTISAMPLE 0x809D
|
||||
#endif
|
||||
|
||||
#ifndef GL_MULTISAMPLE_FILTER_HINT_NV
|
||||
#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
|
||||
#endif
|
||||
|
||||
#define TEXNUM_LIGHTMAPS 1024
|
||||
#define TEXNUM_SCRAPS 1152
|
||||
#define TEXNUM_IMAGES 1153
|
||||
|
@ -161,6 +143,7 @@ extern cvar_t *gl1_overbrightbits;
|
|||
|
||||
extern cvar_t *gl1_palettedtexture;
|
||||
extern cvar_t *gl1_pointparameters;
|
||||
extern cvar_t *gl1_multitexture;
|
||||
|
||||
extern cvar_t *gl1_particle_min_size;
|
||||
extern cvar_t *gl1_particle_max_size;
|
||||
|
@ -230,6 +213,9 @@ void R_TranslatePlayerSkin(int playernum);
|
|||
void R_Bind(int texnum);
|
||||
|
||||
void R_TexEnv(GLenum value);
|
||||
void R_SelectTexture(GLenum);
|
||||
void R_MBind(GLenum target, int texnum);
|
||||
void R_EnableMultitexture(qboolean enable);
|
||||
|
||||
void RI_PushDlights(void);
|
||||
|
||||
|
@ -352,6 +338,8 @@ typedef struct
|
|||
qboolean npottextures;
|
||||
qboolean palettedtexture;
|
||||
qboolean pointparameters;
|
||||
qboolean multitexture;
|
||||
qboolean mtexcombine;
|
||||
|
||||
// ----
|
||||
|
||||
|
|
|
@ -44,54 +44,39 @@
|
|||
#define APIENTRY
|
||||
#endif
|
||||
|
||||
#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
|
||||
// Extracted from <glext.h>
|
||||
#ifndef GL_VERSION_1_4
|
||||
#define GL_POINT_SIZE_MIN 0x8126
|
||||
#define GL_POINT_SIZE_MAX 0x8127
|
||||
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
|
||||
#endif
|
||||
|
||||
#define GL_POINT_SIZE_MIN_EXT 0x8126
|
||||
#define GL_POINT_SIZE_MAX_EXT 0x8127
|
||||
#define GL_DISTANCE_ATTENUATION_EXT 0x8129
|
||||
#ifndef GL_VERSION_1_3
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#define GL_MULTISAMPLE 0x809D
|
||||
#define GL_COMBINE 0x8570
|
||||
#define GL_COMBINE_RGB 0x8571
|
||||
#define GL_COMBINE_ALPHA 0x8572
|
||||
#define GL_SOURCE0_RGB 0x8580
|
||||
#define GL_SOURCE1_RGB 0x8581
|
||||
#define GL_SOURCE0_ALPHA 0x8588
|
||||
#define GL_SOURCE1_ALPHA 0x8589
|
||||
#define GL_RGB_SCALE 0x8573
|
||||
#define GL_PREVIOUS 0x8578
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_env_combine
|
||||
#define GL_COMBINE_EXT 0x8570
|
||||
#define GL_COMBINE_RGB_EXT 0x8571
|
||||
#define GL_COMBINE_ALPHA_EXT 0x8572
|
||||
#define GL_RGB_SCALE_EXT 0x8573
|
||||
#define GL_ADD_SIGNED_EXT 0x8574
|
||||
#define GL_INTERPOLATE_EXT 0x8575
|
||||
#define GL_CONSTANT_EXT 0x8576
|
||||
#define GL_PRIMARY_COLOR_EXT 0x8577
|
||||
#define GL_PREVIOUS_EXT 0x8578
|
||||
#define GL_SOURCE0_RGB_EXT 0x8580
|
||||
#define GL_SOURCE1_RGB_EXT 0x8581
|
||||
#define GL_SOURCE2_RGB_EXT 0x8582
|
||||
#define GL_SOURCE3_RGB_EXT 0x8583
|
||||
#define GL_SOURCE4_RGB_EXT 0x8584
|
||||
#define GL_SOURCE5_RGB_EXT 0x8585
|
||||
#define GL_SOURCE6_RGB_EXT 0x8586
|
||||
#define GL_SOURCE7_RGB_EXT 0x8587
|
||||
#define GL_SOURCE0_ALPHA_EXT 0x8588
|
||||
#define GL_SOURCE1_ALPHA_EXT 0x8589
|
||||
#define GL_SOURCE2_ALPHA_EXT 0x858A
|
||||
#define GL_SOURCE3_ALPHA_EXT 0x858B
|
||||
#define GL_SOURCE4_ALPHA_EXT 0x858C
|
||||
#define GL_SOURCE5_ALPHA_EXT 0x858D
|
||||
#define GL_SOURCE6_ALPHA_EXT 0x858E
|
||||
#define GL_SOURCE7_ALPHA_EXT 0x858F
|
||||
#define GL_OPERAND0_RGB_EXT 0x8590
|
||||
#define GL_OPERAND1_RGB_EXT 0x8591
|
||||
#define GL_OPERAND2_RGB_EXT 0x8592
|
||||
#define GL_OPERAND3_RGB_EXT 0x8593
|
||||
#define GL_OPERAND4_RGB_EXT 0x8594
|
||||
#define GL_OPERAND5_RGB_EXT 0x8595
|
||||
#define GL_OPERAND6_RGB_EXT 0x8596
|
||||
#define GL_OPERAND7_RGB_EXT 0x8597
|
||||
#define GL_OPERAND0_ALPHA_EXT 0x8598
|
||||
#define GL_OPERAND1_ALPHA_EXT 0x8599
|
||||
#define GL_OPERAND2_ALPHA_EXT 0x859A
|
||||
#define GL_OPERAND3_ALPHA_EXT 0x859B
|
||||
#define GL_OPERAND4_ALPHA_EXT 0x859C
|
||||
#define GL_OPERAND5_ALPHA_EXT 0x859D
|
||||
#define GL_OPERAND6_ALPHA_EXT 0x859E
|
||||
#define GL_OPERAND7_ALPHA_EXT 0x859F
|
||||
#ifndef GL_EXT_shared_texture_palette
|
||||
#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_multisample_filter_hint
|
||||
#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
|
||||
#endif
|
||||
|
||||
// =======================================================================
|
||||
|
@ -99,7 +84,7 @@
|
|||
/*
|
||||
* This is responsible for setting up our QGL extension pointers
|
||||
*/
|
||||
qboolean QGL_Init ( void );
|
||||
void QGL_Init ( void );
|
||||
|
||||
/*
|
||||
* Unloads the specified DLL then nulls out all the proc pointers.
|
||||
|
@ -107,10 +92,12 @@ qboolean QGL_Init ( void );
|
|||
void QGL_Shutdown ( void );
|
||||
|
||||
/* GL extensions */
|
||||
extern void ( APIENTRY *qglPointParameterfARB ) ( GLenum param, GLfloat value );
|
||||
extern void ( APIENTRY *qglPointParameterfvARB ) ( GLenum param,
|
||||
extern void ( APIENTRY *qglPointParameterf ) ( GLenum param, GLfloat value );
|
||||
extern void ( APIENTRY *qglPointParameterfv ) ( GLenum param,
|
||||
const GLfloat *value );
|
||||
extern void ( APIENTRY *qglColorTableEXT ) ( GLenum, GLenum, GLsizei, GLenum,
|
||||
GLenum, const GLvoid * );
|
||||
extern void ( APIENTRY *qglActiveTexture ) ( GLenum texture );
|
||||
extern void ( APIENTRY *qglClientActiveTexture ) ( GLenum texture );
|
||||
|
||||
#endif
|
||||
|
|
|
@ -38,18 +38,22 @@
|
|||
/*
|
||||
* GL extensions
|
||||
*/
|
||||
void (APIENTRY *qglPointParameterfARB)(GLenum param, GLfloat value);
|
||||
void (APIENTRY *qglPointParameterfvARB)(GLenum param, const GLfloat *value);
|
||||
void (APIENTRY *qglPointParameterf)(GLenum param, GLfloat value);
|
||||
void (APIENTRY *qglPointParameterfv)(GLenum param, const GLfloat *value);
|
||||
void (APIENTRY *qglColorTableEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum,
|
||||
const GLvoid *);
|
||||
void (APIENTRY *qglActiveTexture) (GLenum texture);
|
||||
void (APIENTRY *qglClientActiveTexture) (GLenum texture);
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
static void QGL_EXT_Reset ( void )
|
||||
{
|
||||
qglPointParameterfARB = NULL;
|
||||
qglPointParameterfvARB = NULL;
|
||||
qglColorTableEXT = NULL;
|
||||
qglPointParameterf = NULL;
|
||||
qglPointParameterfv = NULL;
|
||||
qglColorTableEXT = NULL;
|
||||
qglActiveTexture = NULL;
|
||||
qglClientActiveTexture = NULL;
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
|
@ -63,11 +67,10 @@ QGL_Shutdown ( void )
|
|||
|
||||
/* ========================================================================= */
|
||||
|
||||
qboolean
|
||||
void
|
||||
QGL_Init (void)
|
||||
{
|
||||
// Reset GL extension pointers
|
||||
QGL_EXT_Reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue