X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=a94aa8f38efb436b54f70ae873b744bdaca38f1d;hb=5be63297013e21ede65121040b2bff13dd4fecac;hp=36faaf9743e18012e9b2e384c0a04e15629f99fd;hpb=ed6b95e994d10023d3d6a230667f019373fe50b5;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 36faaf9..a94aa8f 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -29,12 +29,16 @@ #include "freeglut_internal.h" #include #include -#if HAVE_VPRINTF +#if TARGET_HOST_WIN32 # define VFPRINTF(s,f,a) vfprintf((s),(f),(a)) -#elif HAVE_DOPRNT -# define VFPRINTF(s,f,a) _doprnt((f),(a),(s)) #else -# define VFPRINTF(s,f,a) +# if HAVE_VPRINTF +# define VFPRINTF(s,f,a) vfprintf((s),(f),(a)) +# elif HAVE_DOPRNT +# define VFPRINTF(s,f,a) _doprnt((f),(a),(s)) +# else +# define VFPRINTF(s,f,a) +# endif #endif #if TARGET_HOST_WINCE @@ -777,12 +781,8 @@ void FGAPIENTRY glutMainLoopEvent( void ) fgState.Modifiers = fghGetXModifiers( &event ); - /* - * Finally execute the mouse or mouse wheel callback - * - * XXX Use a symbolic constant, *not* "4"! ("3, sire!") - */ - if( ( button < 3 ) || ( ! FETCH_WCB( *window, MouseWheel ) ) ) + /* Finally execute the mouse or mouse wheel callback */ + if( ( button < glutDeviceGet ( GLUT_NUM_MOUSE_BUTTONS ) ) || ( ! FETCH_WCB( *window, MouseWheel ) ) ) INVOKE_WCB( *window, Mouse, ( button, pressed ? GLUT_DOWN : GLUT_UP, event.xbutton.x, @@ -802,7 +802,7 @@ void FGAPIENTRY glutMainLoopEvent( void ) * XXX Note that {button} has already been decremeted * XXX in mapping from X button numbering to GLUT. */ - int wheel_number = (button - 3) / 2; + int wheel_number = (button - glutDeviceGet ( GLUT_NUM_MOUSE_BUTTONS )) / 2; int direction = -1; if( button % 2 ) direction = 1; @@ -862,13 +862,13 @@ void FGAPIENTRY glutMainLoopEvent( void ) if( event.type == KeyPress ) { - keyboard_cb = FETCH_WCB( *window, Keyboard ); - special_cb = FETCH_WCB( *window, Special ); + keyboard_cb = (FGCBKeyboard)( FETCH_WCB( *window, Keyboard )); + special_cb = (FGCBSpecial) ( FETCH_WCB( *window, Special )); } else { - keyboard_cb = FETCH_WCB( *window, KeyboardUp ); - special_cb = FETCH_WCB( *window, SpecialUp ); + keyboard_cb = (FGCBKeyboard)( FETCH_WCB( *window, KeyboardUp )); + special_cb = (FGCBSpecial) ( FETCH_WCB( *window, SpecialUp )); } /* Is there a keyboard/special callback hooked for this window? */