From: Brian Paul Date: Sat, 3 May 2008 15:08:42 +0000 (-0600) Subject: Press to reset limit/bias values, clean-up limit/bias printf X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc57a7c9f7e5f70d77e7f02da2a214a56fad1d80;p=mesa.git Press to reset limit/bias values, clean-up limit/bias printf --- 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"); }