X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=scene.c;h=81c5b562361e52da32384c9c6e0cee3dafcf7389;hp=2894066821781bea5cadc640c1aeb78792b14795;hb=e4ce2f6ee4857a66d2f9845c5dc10e35b80f3946;hpb=aab8c373bc59bdad20006d4429a67d75c46de0fa diff --git a/scene.c b/scene.c index 2894066..81c5b56 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(); @@ -698,8 +705,9 @@ int main(int argc, char **argv) { glutReshapeFunc(windowReshape); glutDisplayFunc(display); - glutMouseFunc(mouse); - glutMotionFunc(motion); + //glutMouseFunc(mouse); + //glutMotionFunc(motion); + glutIdleFunc(idle); makeMenu();