X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=a786b4f73601392d8d16d626f97e0097c8cba8b6;hb=1334fab6bdba435989bf7a9112759dea1d4b3696;hp=5174c7b0ae090e5adf59200de6cbb001541eb4f4;hpb=12965126f5f67bdf811a482b6e4c046f559a0645;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index 5174c7b..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__) @@ -247,13 +251,13 @@ static void fghJoystickRawRead ( SFG_Joystick* joy, int* buttons, float* axes ) if( status != JS_RETURN ) { - fgWarning( joy->fname ); + fgWarning( "%s", joy->fname ); joy->error = TRUE; return; } 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),