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