X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=a786b4f73601392d8d16d626f97e0097c8cba8b6;hb=1334fab6bdba435989bf7a9112759dea1d4b3696;hp=63d786458293cb57cf8cb2f5d939906778ae32ff;hpb=5ea3854c0c128a32bcf1f11d9fd30f92212b455b;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index 63d7864..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),