From bc9211f84f6c3e269c4bf55c5f2363490b02b7ce Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Sun, 9 Oct 2011 14:52:34 +0800 Subject: [PATCH] --- scene.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scene.c b/scene.c index b85ed9f..2f3d206 100644 --- a/scene.c +++ b/scene.c @@ -464,7 +464,7 @@ void makeMenu() { * @param h New height */ void windowReshape(int w, int h) { - glViewport(0, 0, w, h); // Reset The Current Viewport + /* glViewport(0, 0, w, h); // Reset The Current Viewport glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix @@ -472,16 +472,16 @@ void windowReshape(int w, int h) { 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); - 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(); // Reset The Modelview Matrix*/ + + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); /* switch matrix mode*/ + glLoadIdentity(); + if (w <= h) + gluOrtho2D(-10.0, 10.0, -10.0 * (GLfloat) h / (GLfloat) w, 10.0 * (GLfloat) h / (GLfloat) w); + else + gluOrtho2D(-10.0 * (GLfloat) w / (GLfloat) h, 10.0 * (GLfloat) w / (GLfloat) h, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); /* return to modelview mode */ } /** -- 2.20.1