From 1c3737ff7243026c5707c4ae8fc0fd9333dd083b Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Sun, 9 Oct 2011 19:26:10 +0800 Subject: [PATCH 1/1] Tidy and more implementation: * added Javadoc style information on all functions * rearranged content to be in better places * added dummy switch statements for menu event handlers * commented out currently unimplemented menus * implemented window reshaping function * created dummy mouse event function * added more gl initialisation stuff * added dummy teapot drawing for testing purposes --- scene.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scene.c b/scene.c index 30d982a..c7db7d9 100644 --- a/scene.c +++ b/scene.c @@ -468,15 +468,14 @@ void windowReshape(int w, int h) { GLdouble far = 10.0; glViewport(0, 0, (GLsizei) w, (GLsizei) h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - if (w <= h) - glOrtho(near, far, near*(GLfloat)h/(GLfloat)w, - far*(GLfloat)h/(GLfloat)w, near, far); - - else - glOrtho(near*(GLfloat)w/(GLfloat)h, - far*(GLfloat)w/(GLfloat)h, near, far, near, far); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho(near, far, near*(GLfloat)h/(GLfloat)w, + far*(GLfloat)h/(GLfloat)w, near, far); + else + glOrtho(near*(GLfloat)w/(GLfloat)h, + far*(GLfloat)w/(GLfloat)h, near, far, near, far); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } -- 2.20.1