X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=a786b4f73601392d8d16d626f97e0097c8cba8b6;hb=1334fab6bdba435989bf7a9112759dea1d4b3696;hp=1c0e3214cd7fde336c6e1cc78cb5f355867ad7e0;hpb=dd6c1d0a828e629798bed459c2e020abe8c1dab9;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index 1c0e321..a786b4f 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -56,8 +56,12 @@ #else # include # include -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__NetBSD__) +# if __FreeBSD_version >= 500000 # include +# else +# include +# endif # define JS_DATA_TYPE joystick # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) # elif defined(__linux__) @@ -253,7 +257,7 @@ static void fghJoystickRawRead ( SFG_Joystick* joy, int* buttons, float* axes ) } if( buttons ) -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__NetBSD__) *buttons = (joy->js.b1 ? 1 : 0) | (joy->js.b2 ? 2 : 0); # else *buttons = joy->js.buttons; @@ -567,6 +571,7 @@ void fgJoystickPollWindow( SFG_Window* window ) /* * Execute the freeglut joystick callback now */ + fgSetWindow (window); window->Callbacks.Joystick( buttons, (int) (axes[ 0 ] * 1000.0f),