From: Ash Tyndall Date: Sun, 9 Oct 2011 11:26:10 +0000 (+0800) Subject: Tidy and more implementation: X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1c3737ff7243026c5707c4ae8fc0fd9333dd083b;hp=def47f5467d5b96672c25d79034c88471d580724;p=atyndall%2Fcits2231.git 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 --- 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(); }