diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2006-06-21 14:04:04 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2006-06-21 14:04:04 +0000 |
commit | 5fb9f80e3775dc2d8906cfd90c3ca48ce19178ba (patch) | |
tree | b8d6a8cb454a87c838ff7afb79ecfca5077de55a /progs/tests | |
parent | 942b5b7bc08227f385b6a99167ad763a2843dc9a (diff) | |
download | external_mesa3d-5fb9f80e3775dc2d8906cfd90c3ca48ce19178ba.zip external_mesa3d-5fb9f80e3775dc2d8906cfd90c3ca48ce19178ba.tar.gz external_mesa3d-5fb9f80e3775dc2d8906cfd90c3ca48ce19178ba.tar.bz2 |
exercise min/max lod
Diffstat (limited to 'progs/tests')
-rw-r--r-- | progs/tests/mipmap_limits.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/progs/tests/mipmap_limits.c b/progs/tests/mipmap_limits.c index 6f6d893..3bcb8a8 100644 --- a/progs/tests/mipmap_limits.c +++ b/progs/tests/mipmap_limits.c @@ -54,6 +54,7 @@ #include <GL/glut.h> static GLint BaseLevel = 0, MaxLevel = 8; +static GLfloat MinLod = -1, MaxLod = 9; static GLfloat LodBias = 0.0; static GLboolean NearestFilter = GL_TRUE; @@ -124,12 +125,15 @@ static void myinit(void) static void display(void) { GLfloat tcm = 4.0; - printf("GL_TEXTURE_BASE_LEVEL = %d GL_TEXTURE_MAX_LEVEL = %d Bias = %.2g filter = %s\n", - BaseLevel, MaxLevel, LodBias, + printf("BASE_LEVEL = %d MAX_LEVEL = %d MIN_LOD = %f MAX_LOD = %f Bias = %.2g filter = %s\n", + BaseLevel, MaxLevel, MinLod, MaxLod, LodBias, NearestFilter ? "LINEAR" : "NEAREST"); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod); + if (NearestFilter) { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, @@ -195,6 +199,18 @@ key(unsigned char k, int x, int y) case 'L': LodBias += 0.02; break; + case 'n': + MinLod -= 0.02; + break; + case 'N': + MinLod += 0.02; + break; + case 'x': + MaxLod -= 0.02; + break; + case 'X': + MaxLod += 0.02; + break; case 'f': NearestFilter = !NearestFilter; break; @@ -213,6 +229,9 @@ static void usage(void) printf("usage:\n"); printf(" b/B decrease/increase GL_TEXTURE_BASE_LEVEL\n"); printf(" m/M decrease/increase GL_TEXTURE_MAX_LEVEL\n"); + printf(" n/N decrease/increase GL_TEXTURE_MIN_LOD\n"); + printf(" x/X decrease/increase GL_TEXTURE_MAX_LOD\n"); + printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n"); printf(" f toggle nearest/linear filtering\n"); } |