X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=49782affe5cbfff2ad1f5923a6ca4175c648c5c1;hb=1e95989edd005627e67b3ef02810c584e6a98895;hp=513ba51fa52e6b787f63e8b93db22d01c5f91dcf;hpb=c8fad8604c2a85c7400234f8df73d70e99283413;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index 513ba51..49782af 100644 --- a/scene.c +++ b/scene.c @@ -464,7 +464,15 @@ void makeMenu() { * @param h New height */ void windowReshape(int w, int h) { + 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,(GLfloat)w/(GLfloat)h,0.1f,100.0f); + + glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix + glLoadIdentity(); // Reset The Modelview Matrix } /** @@ -488,8 +496,7 @@ void display() { glTranslatef(-1.5f, 0.0f, -6.0f); glBegin(GL_QUADS); - - glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red + glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red glVertex3f(-1.0f, 1.0f, 0.0f); // Top left glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right