X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=b85ed9f38fd862c8df463e501286d0b3f15e0811;hb=688788bca476f49c2a198755204816f105267a14;hp=f899dd8e3cd8f5a9ae6b02de8e901563f61d6ddb;hpb=bfb8cab4390e0707a66fa2cdf10ff41d274ebd62;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index f899dd8..b85ed9f 100644 --- a/scene.c +++ b/scene.c @@ -464,8 +464,18 @@ void makeMenu() { * @param h New height */ void windowReshape(int w, int h) { - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); /* switch matrix mode */ + glViewport(0, 0, w, h); // Reset The Current Viewport + glMatrixMode(GL_PROJECTION); // Select The Projection Matrix + glLoadIdentity(); // Reset The Projection Matrix + + // Calculate The Aspect Ratio Of The Window + gluPerspective(45.0f,45.0f,0.1f,100.0f); + + glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix + glLoadIdentity(); // Reset The Modelview Matrix + + /*glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); /* switch matrix mode glLoadIdentity(); if (w <= h) gluOrtho2D(-2.0, 2.0, -2.0 * (GLfloat) h / (GLfloat) w, 2.0 * (GLfloat) h / (GLfloat) w);