From: Tobias Leich Date: Thu, 5 Nov 2009 18:51:08 +0000 (+0100) Subject: added JoyBallEvent X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=20c3848d75de695b3b44ae7ce7b392cc14538d66;p=sdlgit%2FSDL_perl.git added JoyBallEvent --- diff --git a/Build.PL b/Build.PL index 233147a..9c155a1 100644 --- a/Build.PL +++ b/Build.PL @@ -63,6 +63,13 @@ my %subsystems = }, libraries => [qw( SDL )], }, + JoyBallEvent => { + file => { + from => 'src/Core/objects/JoyBallEvent.xs', + to => 'lib/SDL/JoyBallEvent.xs', + }, + libraries => [qw( SDL )], + }, # JoyButtonEvent => { # file => { # from => 'src/Core/objects/JoyButtonEvent.xs', diff --git a/src/Core/objects/JoyBallEvent.xs b/src/Core/objects/JoyBallEvent.xs new file mode 100644 index 0000000..1601596 --- /dev/null +++ b/src/Core/objects/JoyBallEvent.xs @@ -0,0 +1,65 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef aTHX_ +#define aTHX_ +#endif + +#include + +MODULE = SDL::JoyBallEvent PACKAGE = SDL::JoyBallEvent PREFIX = jtevent_ + +=for documentation + +SDL_JoyBallEvent -- Joystick trackball motion event structure + + typedef struct{ + Uint8 type; + Uint8 which; + Uint8 ball; + Sint16 xrel, yrel; + } SDL_JoyBallEvent; + + +=cut + +Uint8 +jtevent_type ( event, ... ) + SDL_JoyBallEvent *event + CODE: + RETVAL = event->type; + OUTPUT: + RETVAL + +Uint8 +jtevent_which ( event, ... ) + SDL_JoyBallEvent *event + CODE: + RETVAL = event->which; + OUTPUT: + RETVAL + +Uint8 +jtevent_ball ( event, ... ) + SDL_JoyBallEvent *event + CODE: + RETVAL = event->ball; + OUTPUT: + RETVAL + +Sint16 +jtevent_xrel ( event, ... ) + SDL_JoyBallEvent *event + CODE: + RETVAL = event->xrel; + OUTPUT: + RETVAL + +Sint16 +jtevent_yrel ( event, ... ) + SDL_JoyBallEvent *event + CODE: + RETVAL = event->yrel; + OUTPUT: + RETVAL diff --git a/src/Core/objects/JoyHatEvent.xs b/src/Core/objects/JoyHatEvent.xs index 390890b..fd3ff11 100644 --- a/src/Core/objects/JoyHatEvent.xs +++ b/src/Core/objects/JoyHatEvent.xs @@ -48,7 +48,7 @@ jhevent_hat ( event, ... ) OUTPUT: RETVAL -Sint16 +Uint8 jhevent_value ( event, ... ) SDL_JoyHatEvent *event CODE: