summaryrefslogtreecommitdiff
path: root/progs/tests/mipmap_view.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2009-04-22 21:41:57 +1000
committerDave Airlie <airlied@linux.ie>2009-04-22 21:41:57 +1000
commit466c78c93538f2853449124c06274d538830cd5a (patch)
treea6bd88060ba328d8bed1ff2ea1a37ee741a90a17 /progs/tests/mipmap_view.c
parent65fe0c86ffcff99f9f09606d462bf3731ea0c308 (diff)
parentf057f6543da469f231d551cb5728d98df8add4fa (diff)
Merge remote branch 'origin/master' into radeon-rewrite
Diffstat (limited to 'progs/tests/mipmap_view.c')
-rw-r--r--progs/tests/mipmap_view.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/progs/tests/mipmap_view.c b/progs/tests/mipmap_view.c
index 16f3584f70..85fc67ac79 100644
--- a/progs/tests/mipmap_view.c
+++ b/progs/tests/mipmap_view.c
@@ -22,6 +22,7 @@ static int TexWidth = 256, TexHeight = 256;
static int WinWidth = 1044, WinHeight = 900;
static GLfloat Bias = 0.0;
static GLboolean ScaleQuads = GL_FALSE;
+static GLboolean Linear = GL_FALSE;
static GLint Win = 0;
@@ -53,6 +54,15 @@ Display(void)
glColor3f(1,1,1);
+ if (Linear) {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+ else {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ }
+
y = WinHeight - 300;
x = 4;
@@ -132,6 +142,9 @@ Key(unsigned char key, int x, int y)
case 'B':
Bias += 10;
break;
+ case 'l':
+ Linear = !Linear;
+ break;
case '0':
case '1':
case '2':
@@ -222,8 +235,6 @@ Init(void)
/* mipmapping required for this extension */
- 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);