X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=a18a3538ed821cf1b0c0333cbc57fba7adbac267;hb=01a73c1e6606b8115239a5fedf4c4f8925057ffa;hp=b806a5feea6cad7e44b9b67923d3125c2e3367af;hpb=aac655470229c3ae17b0ad78dead36b2000a3a67;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index b806a5f..a18a353 100644 --- a/scene.c +++ b/scene.c @@ -464,20 +464,11 @@ void makeMenu() { * @param height New height */ void windowReshape(int width, int height) { - glViewport(0, 0, (GLsizei)width, (GLsizei)height); + glViewport(0, 0, (GLsizei)width, (GLsizei)height); glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - gluPerspective(60, 1, 0.1, 1000.0); - - /*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); - else - gluOrtho2D(-2.0 * (GLfloat) w / (GLfloat) h, 2.0 * (GLfloat) w / (GLfloat) h, -2.0, 2.0); - glMatrixMode(GL_MODELVIEW); /* return to modelview mode */ + glLoadIdentity(); + gluPerspective(60, (GLfloat)height/ (GLfloat)width, 0.1, 1000.0); + glMatrixMode(GL_MODELVIEW); } /**