X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=o2demo;a=blobdiff_plain;f=src%2Fmain.c;fp=src%2Fmain.c;h=97d7469bd86279a2d494af0801b6ba918cef50d0;hp=433993d6774c00012cc456db4b086468800ae18b;hb=4b32bd7bc643379bd4a63c5714cec68c32a0c3c1;hpb=33e90b3faf9071620951b4cb7c2c03d82ec7fe76 diff --git a/src/main.c b/src/main.c index 433993d..97d7469 100644 --- a/src/main.c +++ b/src/main.c @@ -11,6 +11,7 @@ static void keydown(unsigned char c, int x, int y); static void keyup(unsigned char c, int x, int y); static void mouse(int bn, int st, int x, int y); static void motion(int x, int y); +static void sball_button(int bn, int pressed); static unsigned int start_time; @@ -29,6 +30,9 @@ int main(int argc, char **argv) glutKeyboardUpFunc(keyup); glutMouseFunc(mouse); glutMotionFunc(motion); + glutSpaceballMotionFunc(demo_sball_motion); + glutSpaceballRotateFunc(demo_sball_rotate); + glutSpaceballButtonFunc(sball_button); if(demo_init(argc, argv) == -1) { return 1; @@ -96,3 +100,8 @@ static void motion(int x, int y) { demo_mmotion(x, y); } + +static void sball_button(int bn, int pressed) +{ + demo_sball_button(bn - 1, pressed == GLUT_DOWN ? 1 : 0); +}