glLightf(GL_LIGHT0 + i, GL_SPOT_CUTOFF, lightObjs[i].cutoff);
glLighti(GL_LIGHT0 + i, GL_SPOT_EXPONENT, (int)lightObjs[i].exponent );
+ glEnable(GL_LIGHT0 + i);
+
// Draw light ball for light
glPushMatrix();
- glColor3f(1.0, 1.0, 1.0);
+ glColor3f(0.0, 1.0, 1.0);
glTranslatef(lightObjs[i].position[0], lightObjs[i].position[1], lightObjs[i].position[2]);
- glutSolidSphere(lightBallSize, 20, 20);
+ glutSolidSphere(lightBallSize, 20, 20);;
glPopMatrix();
- glEnable(GL_LIGHT0 + i);
}
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 = 5;
}
\ No newline at end of file