added missing GL_MAX_TEXTURE_LOD_BIAS_EXT query
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
static GLfloat Xrot = 0, Yrot = -30, Zrot = 0;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
|
||||
static GLint BiasMin = -200, BiasMax = 500;
|
||||
static GLint BiasMin = -400, BiasMax = 400;
|
||||
|
||||
|
||||
|
||||
@@ -192,6 +192,8 @@ static void SpecialKey( int key, int x, int y )
|
||||
static void Init( void )
|
||||
{
|
||||
const char *exten = (const char *) glGetString(GL_EXTENSIONS);
|
||||
GLfloat maxBias;
|
||||
|
||||
if (!strstr(exten, "GL_EXT_texture_lod_bias")) {
|
||||
printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");
|
||||
exit(1);
|
||||
@@ -207,6 +209,11 @@ static void Init( void )
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias);
|
||||
printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias);
|
||||
BiasMin = -100 * maxBias;
|
||||
BiasMax = 100 * maxBias;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: config.h,v 1.34 2001/07/16 15:54:23 brianp Exp $ */
|
||||
/* $Id: config.h,v 1.35 2001/11/06 15:53:00 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -134,6 +134,9 @@
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
#define MAX_TEXTURE_MAX_ANISOTROPY 16.0
|
||||
|
||||
/* GL_EXT_texture_lod_bias */
|
||||
#define MAX_TEXTURE_LOD_BIAS 4.0
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: context.c,v 1.148 2001/10/18 08:04:57 joukj Exp $ */
|
||||
/* $Id: context.c,v 1.149 2001/11/06 15:53:00 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -738,6 +738,7 @@ init_attrib_groups( GLcontext *ctx )
|
||||
ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
|
||||
ctx->Const.MaxTextureUnits = MAX_TEXTURE_UNITS;
|
||||
ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
|
||||
ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
|
||||
ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
|
||||
ctx->Const.SubPixelBits = SUB_PIXEL_BITS;
|
||||
ctx->Const.MinPointSize = MIN_POINT_SIZE;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: get.c,v 1.71 2001/10/25 23:21:28 brianp Exp $ */
|
||||
/* $Id: get.c,v 1.72 2001/11/06 15:53:00 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -1258,6 +1258,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
|
||||
*params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_lod_bias */
|
||||
case GL_MAX_TEXTURE_LOD_BIAS_EXT:
|
||||
*params = FLOAT_TO_BOOL(ctx->Const.MaxTextureLodBias);
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
|
||||
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
|
||||
@@ -2557,6 +2562,11 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
|
||||
*params = (GLdouble) ctx->Array.FogCoord.Stride;
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_lod_bias */
|
||||
case GL_MAX_TEXTURE_LOD_BIAS_EXT:
|
||||
*params = (GLdouble) ctx->Const.MaxTextureLodBias;
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
|
||||
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
|
||||
@@ -3837,6 +3847,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
|
||||
*params = (GLfloat) ctx->Array.FogCoord.Stride;
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_lod_bias */
|
||||
case GL_MAX_TEXTURE_LOD_BIAS_EXT:
|
||||
*params = ctx->Const.MaxTextureLodBias;
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
|
||||
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
|
||||
@@ -5159,6 +5174,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
|
||||
}
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_lod_bias */
|
||||
case GL_MAX_TEXTURE_LOD_BIAS_EXT:
|
||||
*params = (GLint) ctx->Const.MaxTextureLodBias;
|
||||
break;
|
||||
|
||||
/* GL_EXT_texture_filter_anisotropic */
|
||||
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
|
||||
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: mtypes.h,v 1.51 2001/10/17 13:31:07 brianp Exp $ */
|
||||
/* $Id: mtypes.h,v 1.52 2001/11/06 15:53:00 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -1165,6 +1165,7 @@ struct gl_constants {
|
||||
GLint MaxCubeTextureLevels;
|
||||
GLuint MaxTextureUnits;
|
||||
GLfloat MaxTextureMaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */
|
||||
GLfloat MaxTextureLodBias; /* GL_EXT_texture_lod_bias */
|
||||
GLuint MaxArrayLockSize;
|
||||
GLint SubPixelBits;
|
||||
GLfloat MinPointSize, MaxPointSize; /* aliased */
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: texstate.c,v 1.58 2001/10/17 13:31:07 brianp Exp $ */
|
||||
/* $Id: texstate.c,v 1.59 2001/11/06 15:53:00 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -413,7 +413,8 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
|
||||
if (texUnit->LodBias == param[0])
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
|
||||
texUnit->LodBias = param[0];
|
||||
texUnit->LodBias = CLAMP(param[0], -ctx->Const.MaxTextureLodBias,
|
||||
ctx->Const.MaxTextureLodBias);
|
||||
break;
|
||||
default:
|
||||
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
|
||||
|
Reference in New Issue
Block a user