}
glEnable(GL_LIGHTING);
+}
+
+/**
+ * Sets variables to the state they are in to begin with.
+ */
+void initializeState() {
+ /* Initial light 0 position. */
+ lightObjs[0].position[0] = 4;
+ lightObjs[0].position[1] = 5;
+ lightObjs[0].position[2] = 6;
+ lightObjs[0].position[3] = 0.0;
+
+ /* Initial light 1 position. */
+ lightObjs[1].position[0] = -4;
+ lightObjs[1].position[1] = 5;
+ lightObjs[1].position[2] = -6;
+ lightObjs[1].position[3] = 0.0;
+
+ /* Initial floor texture */
+ currentGroundTexture = 3;
}
\ No newline at end of file
glutMotionFunc(motion);\r
\r
makeMenu();\r
-\r
initializeLights();\r
-\r
- /* Initial light 0 position. */\r
- lightObjs[0].position[0] = 4;\r
- lightObjs[0].position[1] = 5;\r
- lightObjs[0].position[2] = 6;\r
- lightObjs[0].position[3] = 0.0;\r
-\r
- /* Initial light 1 position. */\r
- lightObjs[1].position[0] = -4;\r
- lightObjs[1].position[1] = 5;\r
- lightObjs[1].position[2] = -6;\r
- lightObjs[1].position[3] = 0.0;\r
+ initializeState();\r
\r
glutMainLoop();\r
}
\ No newline at end of file