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

index 233147a..9c155a1 100644 (file)
--- 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 (file)
index 0000000..1601596
--- /dev/null
@@ -0,0 +1,65 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+
+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
index 390890b..fd3ff11 100644 (file)
@@ -48,7 +48,7 @@ jhevent_hat ( event, ... )
        OUTPUT:
                RETVAL
 
-Sint16
+Uint8
 jhevent_value ( event, ... )
        SDL_JoyHatEvent *event
        CODE: