Browse Source

demos: fix aspect ratio in Reshape()

tags/mesa_7_5_rc1
Brian Paul 16 years ago
parent
commit
08a1e1ebcb
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      progs/glsl/bump.c

+ 2
- 1
progs/glsl/bump.c View File

@@ -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);

Loading…
Cancel
Save