(no commit message)
authorAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 12:52:04 +0000 (20:52 +0800)
committerAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 12:52:04 +0000 (20:52 +0800)
scene.c

diff --git a/scene.c b/scene.c
index e08b667..e5d2a17 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -489,10 +489,12 @@ void makeMenu() {
  * @param h New height\r
  */\r
 void windowReshape(int w, int h) {\r
-  zoomFactor = zoomFactor - 1;\r
   glViewport(0, 0, (GLsizei) w, (GLsizei) h);\r
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
+  GLfloat x = 2.0f*(200 + 0.5)/w-1.0;\r
+  GLfloat y = 2.0f*(200 + 0.5)/h-1.0;\r
+  glTranslatef(-x,-y,0.0f);\r
   if (w <= h) \r
     glOrtho(zoomFactor*near, zoomFactor*far, zoomFactor*near*(GLfloat)h/(GLfloat)w,\r
              zoomFactor*far*(GLfloat)h/(GLfloat)w, near, far);\r

UCC git Repository :: git.ucc.asn.au