Probe GL_ARB_multitexture with our new proping logic

And rename gl_ext_multitexture to gl_multitexture.
This commit is contained in:
Yamagi Burmeister 2016-08-06 15:15:18 +02:00
parent dafc41f509
commit bcde80834f
4 changed files with 29 additions and 19 deletions

View file

@ -218,7 +218,7 @@ extern cvar_t *gl_vertex_arrays;
extern cvar_t *gl_ext_swapinterval;
extern cvar_t *gl_palettedtexture;
extern cvar_t *gl_ext_multitexture;
extern cvar_t *gl_multitexture;
extern cvar_t *gl_pointparameters;
extern cvar_t *gl_ext_compiled_vertex_array;
extern cvar_t *gl_ext_mtexcombine;
@ -382,6 +382,7 @@ typedef struct
// ----
qboolean anisotropic;
qboolean multitexture;
qboolean npottextures;
qboolean palettedtexture;
qboolean pointparameters;

View file

@ -148,7 +148,7 @@ R_SetTexturePalette(unsigned palette[256])
void
R_EnableMultitexture(qboolean enable)
{
if (!qglActiveTextureARB)
if (!gl_config.multitexture)
{
return;
}
@ -175,7 +175,7 @@ R_SelectTexture(GLenum texture)
{
int tmu;
if (!qglActiveTextureARB)
if (!gl_config.multitexture)
{
return;
}

View file

@ -97,7 +97,7 @@ cvar_t *gl_particle_att_c;
cvar_t *gl_ext_swapinterval;
cvar_t *gl_palettedtexture;
cvar_t *gl_ext_multitexture;
cvar_t *gl_multitexture;
cvar_t *gl_pointparameters;
cvar_t *gl_ext_compiled_vertex_array;
cvar_t *gl_ext_mtexcombine;
@ -1257,7 +1257,7 @@ R_Register(void)
gl_ext_swapinterval = Cvar_Get("gl_ext_swapinterval", "1", CVAR_ARCHIVE);
gl_palettedtexture = Cvar_Get("gl_palettedtexture", "0", CVAR_ARCHIVE);
gl_ext_multitexture = Cvar_Get("gl_ext_multitexture", "0", CVAR_ARCHIVE);
gl_multitexture = Cvar_Get("gl_multitexture", "0", 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);
@ -1497,25 +1497,34 @@ R_Init(void *hinstance, void *hWnd)
// ----
/* TODO */
/* Multitexturing */
VID_Printf(PRINT_ALL, " - Multitexturing: ");
if (strstr(gl_config.extensions_string, "GL_ARB_multitexture"))
{
if (gl_ext_multitexture->value)
qglMultiTexCoord2fARB = (void *)GLimp_GetProcAddress("glMultiTexCoord2fARB");
qglMultiTexCoord2fvARB = (void *)GLimp_GetProcAddress("glMultiTexCoord2fvARB");
qglActiveTextureARB = (void *)GLimp_GetProcAddress("glActiveTextureARB");
qglClientActiveTextureARB = (void *)GLimp_GetProcAddress("glClientActiveTextureARB");
}
gl_config.multitexture = false;
if (gl_multitexture->value)
{
if (qglMultiTexCoord2fARB && qglMultiTexCoord2fvARB && qglActiveTextureARB && qglClientActiveTextureARB)
{
VID_Printf(PRINT_ALL, "...using GL_ARB_multitexture\n");
qglMultiTexCoord2fARB = ( void * ) GLimp_GetProcAddress ( "glMultiTexCoord2fARB" );
qglMultiTexCoord2fvARB = (void * ) GLimp_GetProcAddress( "glMultiTexCoord2fvARB" );
qglActiveTextureARB = ( void * ) GLimp_GetProcAddress ( "glActiveTextureARB" );
qglClientActiveTextureARB = ( void * ) GLimp_GetProcAddress ( "glClientActiveTextureARB" );
gl_config.multitexture = true;
VID_Printf(PRINT_ALL, "Okay\n");
}
else
{
VID_Printf(PRINT_ALL, "...ignoring GL_ARB_multitexture\n");
VID_Printf(PRINT_ALL, "Failed\n");
}
}
else
{
VID_Printf(PRINT_ALL, "...GL_ARB_multitexture not found\n");
VID_Printf(PRINT_ALL, "Disabled\n");
}
// ----

View file

@ -575,7 +575,7 @@ R_DrawTextureChains(void)
c_visible_textures = 0;
if (!qglActiveTextureARB)
if (!gl_config.multitexture)
{
for (i = 0, image = gltextures; i < numgltextures; i++, image++)
{
@ -876,7 +876,7 @@ R_DrawInlineBModel(void)
psurf->texturechain = r_alpha_surfaces;
r_alpha_surfaces = psurf;
}
else if (qglMultiTexCoord2fARB && !(psurf->flags & SURF_DRAWTURB))
else if (gl_config.multitexture && !(psurf->flags & SURF_DRAWTURB))
{
R_RenderLightmappedPoly(psurf);
}
@ -891,7 +891,7 @@ R_DrawInlineBModel(void)
if (!(currententity->flags & RF_TRANSLUCENT))
{
if (!qglMultiTexCoord2fARB)
if (!gl_config.multitexture)
{
R_BlendLightmaps();
}
@ -1151,7 +1151,7 @@ R_RecursiveWorldNode(mnode_t *node)
}
else
{
if (qglMultiTexCoord2fARB && !(surf->flags & SURF_DRAWTURB))
if (gl_config.multitexture && !(surf->flags & SURF_DRAWTURB))
{
R_RenderLightmappedPoly(surf);
}
@ -1199,7 +1199,7 @@ R_DrawWorld(void)
memset(gl_lms.lightmap_surfaces, 0, sizeof(gl_lms.lightmap_surfaces));
R_ClearSkyBox();
if (qglMultiTexCoord2fARB)
if (gl_config.multitexture)
{
R_EnableMultitexture(true);