(no commit message)
authorAsh Tyndall <[email protected]>
Fri, 21 Oct 2011 01:29:01 +0000 (09:29 +0800)
committerAsh Tyndall <[email protected]>
Fri, 21 Oct 2011 01:29:01 +0000 (09:29 +0800)
scene.c

diff --git a/scene.c b/scene.c
index 9b4db15..230901a 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -291,7 +291,12 @@ void display() {
   glMatrixMode(GL_PROJECTION);\r
   glLoadIdentity();\r
 \r
-  float aspect = (float)width / (float)height;\r
+  float aspect;\r
+  if ( width <= height ) {\r
+    aspect = (float)height / (float)width;\r
+  } else {\r
+    aspect = (float)width / (float)height;\r
+  }\r
 \r
   gluPerspective(\r
     75.0,\r
@@ -407,7 +412,7 @@ int main(int argc, char **argv) {
   glDepthRange(0,1);\r
   glEnable(GL_DEPTH_TEST); // Enables Depth Testing\r
   glDepthFunc(GL_LEQUAL);  // the type\r
-  glEnable(GL_CULL_FACE);\r
+  //glEnable(GL_CULL_FACE);\r
   glEnable(GL_TEXTURE_2D);\r
   glEnable(GL_NORMALIZE);\r
   glLineWidth(1.0);\r

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