Sorry if this topic has been answered before on these forums. I searched google, my superbible book, and these forums, but I must not know the right keywords to find my answer.
Basically, my 3D graphics look stretched if my aspect ratio is not a perfect 1:1, how do I fix this?
Here is what I am currently using:
void changeSize(int w, int h) //called when the application window is resized
{
ratio = 1.0f * w / h;
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Set the clipping volume
gluPerspective(45,ratio,1,1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glutPostRedisplay();
}