mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-13 14:28:01 +00:00
support for GL_ARB_texture_non_power_of_two, patch from Eric Wasylishen.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@931 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
88437cd8b1
commit
b99a7ea72a
3 changed files with 27 additions and 4 deletions
|
@ -981,10 +981,13 @@ static void TexMgr_LoadImage32 (gltexture_t *glt, unsigned *data)
|
|||
{
|
||||
int internalformat, miplevel, mipwidth, mipheight, picmip;
|
||||
|
||||
if (!gl_texture_NPOT)
|
||||
{
|
||||
// resample up
|
||||
data = TexMgr_ResampleTexture (data, glt->width, glt->height, glt->flags & TEXPREF_ALPHA);
|
||||
glt->width = TexMgr_Pad(glt->width);
|
||||
glt->height = TexMgr_Pad(glt->height);
|
||||
}
|
||||
|
||||
// mipmap down
|
||||
picmip = (glt->flags & TEXPREF_NOPICMIP) ? 0 : q_max((int)gl_picmip.value, 0);
|
||||
|
|
|
@ -82,6 +82,7 @@ qboolean gl_texture_env_add = false; //johnfitz
|
|||
qboolean gl_swap_control = false; //johnfitz
|
||||
qboolean gl_anisotropy_able = false; //johnfitz
|
||||
float gl_max_anisotropy; //johnfitz
|
||||
qboolean gl_texture_NPOT = false; //ericw
|
||||
|
||||
PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc = NULL; //johnfitz
|
||||
PFNGLACTIVETEXTUREARBPROC GL_SelectTextureFunc = NULL; //johnfitz
|
||||
|
@ -660,6 +661,21 @@ static void GL_CheckExtensions (void)
|
|||
gl_max_anisotropy = 1;
|
||||
Con_Warning ("texture_filter_anisotropic not supported\n");
|
||||
}
|
||||
|
||||
//
|
||||
// texture_non_power_of_two
|
||||
//
|
||||
if (COM_CheckParm("-notexturenpot"))
|
||||
Con_Warning ("texture_non_power_of_two disabled at command line\n");
|
||||
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_non_power_of_two"))
|
||||
{
|
||||
Con_Printf("FOUND: GL_ARB_texture_non_power_of_two\n");
|
||||
gl_texture_NPOT = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Warning ("texture_non_power_of_two not supported\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -167,6 +167,10 @@ extern float gl_max_anisotropy;
|
|||
extern qboolean gl_anisotropy_able;
|
||||
//johnfitz
|
||||
|
||||
//ericw -- NPOT texture support
|
||||
extern qboolean gl_texture_NPOT;
|
||||
//ericw
|
||||
|
||||
//johnfitz -- polygon offset
|
||||
#define OFFSET_BMODEL 1
|
||||
#define OFFSET_NONE 0
|
||||
|
|
Loading…
Reference in a new issue