From: Ash Tyndall Date: Tue, 18 Oct 2011 03:22:59 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=023daaaaab63ad4475c5839c7218407903815958;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(); }