From: Tobias Leich Date: Thu, 5 Nov 2009 18:15:30 +0000 (+0100) Subject: added JoyAxisEvent X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e9dce38540681b044a657b9a3e07de370f7bdbc9;p=sdlgit%2FSDL_perl.git added JoyAxisEvent --- diff --git a/Build.PL b/Build.PL index d422e00..0556555 100644 --- a/Build.PL +++ b/Build.PL @@ -56,6 +56,13 @@ my %subsystems = }, libraries => [qw( SDL )], }, + JoyAxisEvent => { + file => { + from => 'src/Core/objects/JoyAxisEvent.xs', + to => 'lib/SDL/JoyAxisEvent.xs', + }, + libraries => [qw( SDL )], + }, KeyboardEvent => { file => { from => 'src/Core/objects/KeyboardEvent.xs', diff --git a/src/Core/objects/JoyAxisEvent.xs b/src/Core/objects/JoyAxisEvent.xs new file mode 100644 index 0000000..4825c38 --- /dev/null +++ b/src/Core/objects/JoyAxisEvent.xs @@ -0,0 +1,57 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef aTHX_ +#define aTHX_ +#endif + +#include + +MODULE = SDL::JoyAxisEvent PACKAGE = SDL::JoyAxisEvent PREFIX = jaevent_ + +=for documentation + +SDL_JoyAxisEvent -- Joystick axis motion event structure + + typedef struct{ + Uint8 type; + Uint8 which; + Uint8 axis; + Sint16 value; + } SDL_JoyAxisEvent; + + +=cut + +Uint8 +jaevent_type ( event, ... ) + SDL_JoyAxisEvent *event + CODE: + RETVAL = event->type; + OUTPUT: + RETVAL + +Uint8 +jaevent_which ( event, ... ) + SDL_JoyAxisEvent *event + CODE: + RETVAL = event->which; + OUTPUT: + RETVAL + +Uint8 +jaevent_button ( event, ... ) + SDL_JoyAxisEvent *event + CODE: + RETVAL = event->axis; + OUTPUT: + RETVAL + +Sint16 +jaevent_value ( event, ... ) + SDL_JoyAxisEvent *event + CODE: + RETVAL = event->value; + OUTPUT: + RETVAL