Mercurial > sdl-ios-xcode
annotate include/SDL_joystick.h @ 4573:6399178be313
Completed work on X11_CreateTexture. Added lots of safety features.
These include support for drawing a texture using the core protocol
while other textures are drawn using Xrender if Xrender does not support
the color format of the said texture or any other fault with Xrender.
author | Sunny Sachanandani <sunnysachanandani@gmail.com> |
---|---|
date | Fri, 28 May 2010 20:40:09 +0530 |
parents | f7b03b6838cb |
children | b530ef003506 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
3697 | 3 Copyright (C) 1997-2010 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
905
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
905
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 9 |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
905
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
905
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
905
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
905
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
251
b8688cfdc232
Updated the headers with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
23 /** |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
24 * \file SDL_joystick.h |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
25 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
26 * Include file for SDL joystick event handling |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
27 */ |
0 | 28 |
29 #ifndef _SDL_joystick_h | |
30 #define _SDL_joystick_h | |
31 | |
1356
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
32 #include "SDL_stdinc.h" |
1358
c71e05b4dc2e
More header massaging... works great on Windows. ;-)
Sam Lantinga <slouken@libsdl.org>
parents:
1356
diff
changeset
|
33 #include "SDL_error.h" |
0 | 34 |
35 #include "begin_code.h" | |
36 /* Set up for C function definitions, even when using C++ */ | |
37 #ifdef __cplusplus | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
38 /* *INDENT-OFF* */ |
0 | 39 extern "C" { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
40 /* *INDENT-ON* */ |
0 | 41 #endif |
42 | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
43 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
44 * \file SDL_joystick.h |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
45 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
46 * In order to use these functions, SDL_Init() must have been called |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
47 * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
48 * for joysticks, and load appropriate drivers. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
49 */ |
0 | 50 |
51 /* The joystick structure used to identify an SDL joystick */ | |
52 struct _SDL_Joystick; | |
53 typedef struct _SDL_Joystick SDL_Joystick; | |
54 | |
55 | |
56 /* Function prototypes */ | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
57 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
58 * Count the number of joysticks attached to the system |
0 | 59 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
60 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); |
0 | 61 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
62 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
63 * Get the implementation dependent name of a joystick. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
64 * This can be called before any joysticks are opened. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
65 * If no name can be found, this function returns NULL. |
0 | 66 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
67 extern DECLSPEC const char *SDLCALL SDL_JoystickName(int device_index); |
0 | 68 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
69 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
70 * Open a joystick for use. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
71 * The index passed as an argument refers tothe N'th joystick on the system. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
72 * This index is the value which will identify this joystick in future joystick |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
73 * events. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
74 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
75 * \return A joystick identifier, or NULL if an error occurred. |
0 | 76 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
77 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); |
0 | 78 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
79 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
80 * Returns 1 if the joystick has been opened, or 0 if it has not. |
0 | 81 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
82 extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); |
0 | 83 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
84 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
85 * Get the device index of an opened joystick. |
0 | 86 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
87 extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick * joystick); |
0 | 88 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
89 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
90 * Get the number of general axis controls on a joystick. |
0 | 91 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
92 extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); |
0 | 93 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
94 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
95 * Get the number of trackballs on a joystick. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
96 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
97 * Joystick trackballs have only relative motion events associated |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
98 * with them and their state cannot be polled. |
0 | 99 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
100 extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); |
0 | 101 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
102 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
103 * Get the number of POV hats on a joystick. |
0 | 104 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
105 extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); |
0 | 106 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
107 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
108 * Get the number of buttons on a joystick. |
0 | 109 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
110 extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); |
0 | 111 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
112 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
113 * Update the current state of the open joysticks. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
114 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
115 * This is called automatically by the event loop if any joystick |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
116 * events are enabled. |
0 | 117 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
118 extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); |
0 | 119 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
120 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
121 * Enable/disable joystick event polling. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
122 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
123 * If joystick events are disabled, you must call SDL_JoystickUpdate() |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
124 * yourself and check the state of the joystick when you want joystick |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
125 * information. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
126 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
127 * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. |
0 | 128 */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
129 extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); |
0 | 130 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
131 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
132 * Get the current state of an axis control on a joystick. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
133 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
134 * The state is a value ranging from -32768 to 32767. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
135 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
136 * The axis indices start at index 0. |
0 | 137 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
138 extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
139 int axis); |
0 | 140 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
141 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
142 * \name Hat positions |
0 | 143 */ |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
144 /*@{*/ |
0 | 145 #define SDL_HAT_CENTERED 0x00 |
146 #define SDL_HAT_UP 0x01 | |
147 #define SDL_HAT_RIGHT 0x02 | |
148 #define SDL_HAT_DOWN 0x04 | |
149 #define SDL_HAT_LEFT 0x08 | |
150 #define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) | |
151 #define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) | |
152 #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) | |
153 #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) | |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
154 /*@}*/ |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
155 |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
156 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
157 * Get the current state of a POV hat on a joystick. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
158 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
159 * The hat indices start at index 0. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
160 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
161 * \return The return value is one of the following positions: |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
162 * - ::SDL_HAT_CENTERED |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
163 * - ::SDL_HAT_UP |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
164 * - ::SDL_HAT_RIGHT |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
165 * - ::SDL_HAT_DOWN |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
166 * - ::SDL_HAT_LEFT |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
167 * - ::SDL_HAT_RIGHTUP |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
168 * - ::SDL_HAT_RIGHTDOWN |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
169 * - ::SDL_HAT_LEFTUP |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
170 * - ::SDL_HAT_LEFTDOWN |
0 | 171 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
172 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
173 int hat); |
0 | 174 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
175 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
176 * Get the ball axis change since the last poll. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
177 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
178 * \return 0, or -1 if you passed it invalid parameters. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
179 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
180 * The ball indices start at index 0. |
0 | 181 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
182 extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
183 int ball, int *dx, int *dy); |
0 | 184 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
185 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
186 * Get the current state of a button on a joystick. |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
187 * |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
188 * The button indices start at index 0. |
0 | 189 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
190 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
191 int button); |
0 | 192 |
3407
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
193 /** |
d3baf5ac4e37
Partial fix for bug #859
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
194 * Close a joystick previously opened with SDL_JoystickOpen(). |
0 | 195 */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
196 extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); |
0 | 197 |
198 | |
199 /* Ends C function definitions when using C++ */ | |
200 #ifdef __cplusplus | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
201 /* *INDENT-OFF* */ |
0 | 202 } |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
203 /* *INDENT-ON* */ |
0 | 204 #endif |
205 #include "close_code.h" | |
206 | |
207 #endif /* _SDL_joystick_h */ | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
208 |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
209 /* vi: set ts=4 sw=4 expandtab: */ |