added JoyAxisEvent
Tobias Leich [Thu, 5 Nov 2009 18:15:30 +0000 (19:15 +0100)]
Build.PL
src/Core/objects/JoyAxisEvent.xs [new file with mode: 0644]

index d422e00..0556555 100644 (file)
--- 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 (file)
index 0000000..4825c38
--- /dev/null
@@ -0,0 +1,57 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+
+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