From 08a1e1ebcb612dfa9172f04e4644b34d95ec7dac Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 9 Apr 2009 17:04:58 -0600 Subject: demos: fix aspect ratio in Reshape() --- progs/glsl/bump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'progs') 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); -- cgit v1.2.3