(no commit message)
authorAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 03:22:59 +0000 (11:22 +0800)
committerAsh Tyndall <[email protected]>
Tue, 18 Oct 2011 03:22:59 +0000 (11:22 +0800)
scene.c

diff --git a/scene.c b/scene.c
index 963f78b..3e0f34f 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -520,6 +520,16 @@ void display() {
    glutSwapBuffers();\r
 }\r
 \r
+/**\r
+ * init function, sets OpenGL's starting state\r
+ */\r
+void init() {\r
+  glMatrixMode(GL_PROJECTION);\r
+  glLoadIdentity();\r
+  gluPerspective( 60, 1, 0.1, 1000.0);\r
+  glMatrixMode(GL_MODELVIEW);\r
+}\r
+\r
 /**\r
  * Main function\r
  * @param argc Number of arguments\r
@@ -559,10 +569,7 @@ int main(int argc, char **argv) {
 \r
     makeMenu();\r
 \r
-    glMatrixMode(GL_PROJECTION);\r
-    glLoadIdentity();\r
-    gluPerspective( 60, 1, 0.1, 1000.0);\r
-    glMatrixMode(GL_MODELVIEW);\r
+    init();\r
 \r
     glutMainLoop();\r
 }\r

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