X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=scene.c;h=af895dedbc35692dcda2e3429b5d0be765ff9090;hb=ce62731a7b410f8514d121cc296ed53d96c5ddf3;hp=3d5583f9c6666e6c70552ea0e7c5ab83c378968f;hpb=55b5f8f1554ca1368031583fb99be833d84a358c;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index 3d5583f..af895de 100644 --- a/scene.c +++ b/scene.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "bitmap.h" @@ -508,7 +509,7 @@ void windowReshape(int w, int h) { */ /*void mouse(int btn, int state, int x, int y) { -}*/ +}*//* static void mouse(int button, int state, int x, int y) { @@ -551,8 +552,15 @@ motion(int x, int y) lightStartY = y; glutPostRedisplay(); } -} +}*/ +void idle() { + angle = (int)(angle + 10) % 360; + angle2 = (int)(angle2 + 10) % 360; + printf("Angle 1: %d, Angle 2: %d", angle, angle2); + sleep(2); + glutPostRedisplay(); +} /** * Draw a floor. @@ -614,8 +622,7 @@ void display() { glPushMatrix(); - //glTranslatef(0.0, 0.0, 0.0); - + glTranslatef(0.0, 0.0, 0.0); glutWireTeapot(30); // Draw teapot for test glPopMatrix(); @@ -692,14 +699,15 @@ int main(int argc, char **argv) { glDepthFunc(GL_LEQUAL); // the type glEnable(GL_CULL_FACE); glEnable(GL_TEXTURE_2D); - glLineWidth(3.0); + glLineWidth(1.0); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glutReshapeFunc(windowReshape); glutDisplayFunc(display); - glutMouseFunc(mouse); - glutMotionFunc(motion); + //glutMouseFunc(mouse); + //glutMotionFunc(motion); + glutIdleFunc(idle); makeMenu();