X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=scene.c;h=3e0f34f5c2a708ad83b160c018af88a76d414f48;hb=023daaaaab63ad4475c5839c7218407903815958;hp=963f78bec7032ce6f465cc73d5a5f5382a3e08ae;hpb=db2ce035b0f1f0c957ce8dbf998a45b799b8aa29;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index 963f78b..3e0f34f 100644 --- a/scene.c +++ b/scene.c @@ -520,6 +520,16 @@ void display() { glutSwapBuffers(); } +/** + * init function, sets OpenGL's starting state + */ +void init() { + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective( 60, 1, 0.1, 1000.0); + glMatrixMode(GL_MODELVIEW); +} + /** * Main function * @param argc Number of arguments @@ -559,10 +569,7 @@ int main(int argc, char **argv) { makeMenu(); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective( 60, 1, 0.1, 1000.0); - glMatrixMode(GL_MODELVIEW); + init(); glutMainLoop(); }