summaryrefslogtreecommitdiff
path: root/progs/demos
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-11-06 15:53:00 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-11-06 15:53:00 +0000
commit87c964d3885d84959f86d5d7d9c4358240b6da3c (patch)
tree02eb6a543e71e371030f17e036bedf48089e2fe2 /progs/demos
parent85e7d7c1d889f867762c6f62070729089f1877ac (diff)
added missing GL_MAX_TEXTURE_LOD_BIAS_EXT query
Diffstat (limited to 'progs/demos')
-rw-r--r--progs/demos/lodbias.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/progs/demos/lodbias.c b/progs/demos/lodbias.c
index b2fab0b4eb..3533241be5 100644
--- a/progs/demos/lodbias.c
+++ b/progs/demos/lodbias.c
@@ -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;
}