0

If I change the window size the objects are deformed(as I know). So Im trying to calculate the aspect but If I do this and I increase the window size only a smal rectangle is rendered.

This are the relevant parts of the code :

Reshape function :

void ReshapeFunc(int x, int y)
{
  aspect = (float) x/y;
}

(apect is defined global)

gluPerspective :

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90, aspect, near, far);
noName
  • 132
  • 1
  • 9

1 Answers1

0

You need to call glViewport(0, 0, width, height) anytime you change the size of the window.

JeppeSRC
  • 89
  • 1
  • 9