X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=4bb8a3720fd09777a6dc0ab06f6fda06936ed47f;hb=fbc36ed71c03ab6aa7b06919d57abfe12b471e18;hp=32ba9178b97e53b8879629fd9308660ca57054b6;hpb=ed72c76d33b105b8e3228fc611f26f6ebe7d5c0b;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index 32ba917..4bb8a37 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -42,8 +42,6 @@ #include "config.h" #endif -#define G_LOG_DOMAIN "freeglut-joystick" - #include "../include/GL/freeglut.h" #include "freeglut_internal.h" @@ -241,7 +239,7 @@ static void fghJoystickRawRead ( SFG_Joystick* joy, int* buttons, float* axes ) case JS_EVENT_BUTTON: if ( joy->js.value == 0 ) /* clear the flag */ joy->tmp_buttons &= ~(1 << joy->js.number); - else + else joy->tmp_buttons |= (1 << joy->js.number); break; @@ -599,17 +597,26 @@ void fgJoystickPollWindow( SFG_Window* window ) int buttons; freeglut_return_if_fail( fgJoystick != NULL && window != NULL ); - freeglut_return_if_fail( window->Callbacks.Joystick != NULL ); + freeglut_return_if_fail( FETCH_WCB( *window, Joystick ) ); fghJoystickRead( fgJoystick, &buttons, axes ); - fgSetWindow (window); - window->Callbacks.Joystick( - buttons, - (int) (axes[ 0 ] * 1000.0f), - (int) (axes[ 1 ] * 1000.0f), - (int) (axes[ 2 ] * 1000.0f) + INVOKE_WCB( *window, Joystick, + ( buttons, + (int) (axes[ 0 ] * 1000.0f ), + (int) (axes[ 1 ] * 1000.0f ), + (int) (axes[ 2 ] * 1000.0f ) ) ); + + /* + * fgSetWindow (window); + * window->Callbacks.Joystick( + * buttons, + * (int) (axes[ 0 ] * 1000.0f), + * (int) (axes[ 1 ] * 1000.0f), + * (int) (axes[ 2 ] * 1000.0f) + * ); + */ } /*