From 023daaaaab63ad4475c5839c7218407903815958 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Tue, 18 Oct 2011 11:22:59 +0800 Subject: [PATCH] --- scene.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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(); } -- 2.20.1