1 .TH "SDL_JoystickOpen" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
3 SDL_JoystickOpen\- Opens a joystick for use\&.
8 \fBSDL_Joystick *\fBSDL_JoystickOpen\fP\fR(\fBint index\fR);
11 Opens a joystick for use within SDL\&. The \fBindex\fR refers to the N\&'th joystick in the system\&. A joystick must be opened before it game be used\&.
14 Returns a \fBSDL_Joystick\fR structure on success\&. \fBNULL\fR on failure\&.
19 \f(CWSDL_Joystick *joy;
21 if(SDL_NumJoysticks()>0){
23 joy=SDL_JoystickOpen(0);
27 printf("Opened Joystick 0
30 ", SDL_JoystickName(0));
31 printf("Number of Axes: %d
32 ", SDL_JoystickNumAxes(joy));
33 printf("Number of Buttons: %d
34 ", SDL_JoystickNumButtons(joy));
35 printf("Number of Balls: %d
36 ", SDL_JoystickNumBalls(joy));
39 printf("Couldn\&'t open Joystick 0
43 if(SDL_JoystickOpened(0))
44 SDL_JoystickClose(joy);
50 \fI\fBSDL_JoystickClose\fP\fR
51 ...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00