Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 137 lines (118 sloc) 2.207 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"

#ifndef aTHX_
#define aTHX_
#endif

#include <SDL.h>

MODULE = SDL::Joystick PACKAGE = SDL::Joystick PREFIX = joystick_

SDL_Joystick *
joystick_new (CLASS, index )
char* CLASS
int index
CODE:
RETVAL = SDL_JoystickOpen(index);
OUTPUT:
RETVAL


int
joystick_num_joysticks ()
CODE:
RETVAL = SDL_NumJoysticks();
OUTPUT:
RETVAL

char *
joystick_name ( index )
int index
CODE:
RETVAL = (char*)SDL_JoystickName(index);
OUTPUT:
RETVAL

int
joystick_opened ( index )
int index
CODE:
RETVAL = SDL_JoystickOpened(index);
OUTPUT:
RETVAL

int
joystick_index ( joystick )
SDL_Joystick *joystick
CODE:
RETVAL = SDL_JoystickIndex(joystick);
OUTPUT:
RETVAL

int
joystick_num_axes ( joystick )
SDL_Joystick *joystick
CODE:
RETVAL = SDL_JoystickNumAxes(joystick);
OUTPUT:
RETVAL

int
joystick_num_balls ( joystick )
SDL_Joystick *joystick
CODE:
RETVAL = SDL_JoystickNumBalls(joystick);
OUTPUT:
RETVAL

int
joystick_num_hats ( joystick )
SDL_Joystick *joystick
CODE:
RETVAL = SDL_JoystickNumHats(joystick);
OUTPUT:
RETVAL

int
joystick_num_buttons ( joystick )
SDL_Joystick *joystick
CODE:
RETVAL = SDL_JoystickNumButtons(joystick);
OUTPUT:
RETVAL

void
joystick_update ()
CODE:
SDL_JoystickUpdate();

Sint16
joystick_get_axis ( joystick, axis )
SDL_Joystick *joystick
int axis
CODE:
RETVAL = SDL_JoystickGetAxis(joystick,axis);
OUTPUT:
RETVAL

Uint8
joystick_get_hat ( joystick, hat )
SDL_Joystick *joystick
int hat
CODE:
RETVAL = SDL_JoystickGetHat(joystick,hat);
OUTPUT:
RETVAL

Uint8
joystick_get_button ( joystick, button)
SDL_Joystick *joystick
int button
CODE:
RETVAL = SDL_JoystickGetButton(joystick,button);
OUTPUT:
RETVAL

AV *
joystick_get_ball ( joystick, ball )
SDL_Joystick *joystick
int ball
CODE:
int success,dx,dy;
success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
RETVAL = (AV*)sv_2mortal((SV*)newAV());
av_push(RETVAL,newSViv(success));
av_push(RETVAL,newSViv(dx));
av_push(RETVAL,newSViv(dy));
OUTPUT:
RETVAL

void
joystick_DESTROY ( joystick )
SDL_Joystick *joystick
CODE:
SDL_JoystickClose(joystick);
Something went wrong with that request. Please try again.