summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-04-09 17:04:58 -0600
committerBrian Paul <brianp@vmware.com>2009-04-09 17:04:58 -0600
commit08a1e1ebcb612dfa9172f04e4644b34d95ec7dac (patch)
tree0b102b31a177a6b8edba8ac555fcc9083d0fdfd3 /progs
parent2078e6cf55e3068454df9d843618b412b6abb811 (diff)
demos: fix aspect ratio in Reshape()
Diffstat (limited to 'progs')
-rw-r--r--progs/glsl/bump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c
index b93ab44b5b..0ea1f8331f 100644
--- a/progs/glsl/bump.c
+++ b/progs/glsl/bump.c
@@ -150,10 +150,11 @@ Redisplay(void)
static void
Reshape(int width, int height)
{
+ float ar = (float) width / (float) height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -15.0f);