diff options
author | Brian Paul <[email protected]> | 2009-04-09 17:04:58 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-04-09 17:04:58 -0600 |
commit | 08a1e1ebcb612dfa9172f04e4644b34d95ec7dac (patch) | |
tree | 0b102b31a177a6b8edba8ac555fcc9083d0fdfd3 /progs/glsl/bump.c | |
parent | 2078e6cf55e3068454df9d843618b412b6abb811 (diff) |
demos: fix aspect ratio in Reshape()
Diffstat (limited to 'progs/glsl/bump.c')
-rw-r--r-- | progs/glsl/bump.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c index b93ab44b5b9..0ea1f8331ff 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); |