X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_callbacks.c;h=a40f7daf82a68d0e0a90b51d36a02e8447c48301;hb=1fd9514b5c5df8a4bf974787f26f6cc3dd84c1cc;hp=4915e19bce0cb479e64f73abc00f9ea84f5daac1;hpb=bb97ecab3add22cf774d3bb8bdb9d1be537cc524;p=freeglut diff --git a/src/freeglut_callbacks.c b/src/freeglut_callbacks.c index 4915e19..a40f7da 100644 --- a/src/freeglut_callbacks.c +++ b/src/freeglut_callbacks.c @@ -179,6 +179,15 @@ void FGAPIENTRY glutJoystickFunc( void (* callback) FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickFunc" ); fgInitialiseJoysticks (); + if ( ( ( fgStructure.CurrentWindow->State.JoystickPollRate < 0 ) || + !FETCH_WCB(*fgStructure.CurrentWindow,Joystick) ) && /* Joystick callback was disabled */ + ( callback && ( pollInterval >= 0 ) ) ) /* but is now enabled */ + ++fgState.NumActiveJoysticks; + else if ( ( ( fgStructure.CurrentWindow->State.JoystickPollRate >= 0 ) && + FETCH_WCB(*fgStructure.CurrentWindow,Joystick) ) && /* Joystick callback was enabled */ + ( !callback || ( pollInterval < 0 ) ) ) /* but is now disabled */ + --fgState.NumActiveJoysticks; + SET_CALLBACK( Joystick ); fgStructure.CurrentWindow->State.JoystickPollRate = pollInterval; @@ -364,4 +373,40 @@ void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) ) SET_CALLBACK( TabletButton ); } +/* + * Sets the multi-pointer entry callback for the current window + */ +void FGAPIENTRY glutMultiEntryFunc( void (* callback)(int, int ) ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMultiEntryFunc" ); + SET_CALLBACK( MultiEntry ); +} + +/* + * Sets the multi-pointer button callback for the current window + */ +void FGAPIENTRY glutMultiButtonFunc( void (* callback)(int, int, int, int, int ) ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMultiButtonFunc" ); + SET_CALLBACK( MultiButton ); +} + +/* + * Sets the multi-pointer motion callback for the current window + */ +void FGAPIENTRY glutMultiMotionFunc( void (* callback)(int, int, int ) ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMultiMotionFunc" ); + SET_CALLBACK( MultiMotion ); +} + +/* + * Sets the multi-pointer passive motion callback for the current window + */ +void FGAPIENTRY glutMultiPassiveFunc( void (* callback)(int, int, int ) ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMultiPassiveFunc" ); + SET_CALLBACK( MultiPassive ); +} + /*** END OF FILE ***/