diff options
author | Brian Paul <[email protected]> | 2008-05-03 09:08:42 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-05-03 09:10:44 -0600 |
commit | bc57a7c9f7e5f70d77e7f02da2a214a56fad1d80 (patch) | |
tree | 6b5ace16c41538ad19cff96b5fcbab12697c187d /progs/tests | |
parent | 3837d401cc665eccf079eba5822b1a3eec565b81 (diff) |
Press <space> to reset limit/bias values, clean-up limit/bias printf
Diffstat (limited to 'progs/tests')
-rw-r--r-- | progs/tests/mipmap_limits.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/progs/tests/mipmap_limits.c b/progs/tests/mipmap_limits.c index d6d6e467b0f..8bdad826f7c 100644 --- a/progs/tests/mipmap_limits.c +++ b/progs/tests/mipmap_limits.c @@ -59,6 +59,18 @@ static GLfloat LodBias = 0.0; static GLboolean NearestFilter = GL_TRUE; +static void +InitValues(void) +{ + BaseLevel = 0; + MaxLevel = 8; + MinLod = -1; + MaxLod = 9; + LodBias = 0.0; + NearestFilter = GL_TRUE; +} + + static void MakeImage(int level, int width, int height, const GLubyte color[4]) { const int makeStripes = 0; @@ -108,6 +120,8 @@ static void makeImages(void) static void myinit(void) { + InitValues(); + glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glShadeModel(GL_FLAT); @@ -125,7 +139,7 @@ static void myinit(void) static void display(void) { GLfloat tcm = 4.0; - printf("BASE_LEVEL = %d MAX_LEVEL = %d MIN_LOD = %f MAX_LOD = %f Bias = %.2g filter = %s\n", + printf("BASE_LEVEL=%d MAX_LEVEL=%d MIN_LOD=%.2g MAX_LOD=%.2g Bias=%.2g Filter=%s\n", BaseLevel, MaxLevel, MinLod, MaxLod, LodBias, NearestFilter ? "NEAREST" : "LINEAR"); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel); @@ -214,6 +228,9 @@ key(unsigned char k, int x, int y) case 'f': NearestFilter = !NearestFilter; break; + case ' ': + InitValues(); + break; case 27: /* Escape */ exit(0); break; @@ -227,12 +244,13 @@ key(unsigned char k, int x, int y) 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"); + 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"); + printf(" SPACE reset values\n"); } |