From 28eeb90dc1735bfcbebbe76ed64ce6f49cb512c0 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Tue, 18 Oct 2011 20:52:04 +0800 Subject: [PATCH] --- scene.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene.c b/scene.c index e08b667..e5d2a17 100644 --- a/scene.c +++ b/scene.c @@ -489,10 +489,12 @@ void makeMenu() { * @param h New height */ void windowReshape(int w, int h) { - zoomFactor = zoomFactor - 1; glViewport(0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); + GLfloat x = 2.0f*(200 + 0.5)/w-1.0; + GLfloat y = 2.0f*(200 + 0.5)/h-1.0; + glTranslatef(-x,-y,0.0f); if (w <= h) glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w, zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far); -- 2.20.1