zenilib: zenilib/jni/external/sdl/SDL/SDL_joystick.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_joystick.h
Go to the documentation of this file.
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
39 #ifndef _SDL_joystick_h
40 #define _SDL_joystick_h
41
42 #include "SDL_stdinc.h"
43 #include "SDL_error.h"
44
45 #include "begin_code.h"
46 /* Set up for C function definitions, even when using C++ */
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
63 /* The joystick structure used to identify an SDL joystick */
64 struct _SDL_Joystick;
65 typedef struct _SDL_Joystick SDL_Joystick;
66
67 /* A structure that encodes the stable unique id for a joystick device */
68 typedef struct {
69 Uint8 data[16];
70 } SDL_JoystickGUID;
71
72 typedef Sint32 SDL_JoystickID;
73
74
75 /* Function prototypes */
79 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
80
86 extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
87
96 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
97
102 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
103
107 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
108
112 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick);
113
118 extern DECLSPEC void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
119
123 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
124
128 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick);
129
133 extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick);
134
138 extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick);
139
146 extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick);
147
151 extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick);
152
156 extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick);
157
164 extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
165
175 extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
176
184 extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
185 int axis);
186
190 /* @{ */
191 #define SDL_HAT_CENTERED 0x00
192 #define SDL_HAT_UP 0x01
193 #define SDL_HAT_RIGHT 0x02
194 #define SDL_HAT_DOWN 0x04
195 #define SDL_HAT_LEFT 0x08
196 #define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
197 #define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
198 #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
199 #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
200 /* @} */
201
218 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick,
219 int hat);
220
228 extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick,
229 int ball, int *dx, int *dy);
230
236 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick,
237 int button);
238
242 extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick);
243
244
245 /* Ends C function definitions when using C++ */
246 #ifdef __cplusplus
247 }
248 #endif
249 #include "close_code.h"
250
251 #endif /* _SDL_joystick_h */
252
253 /* vi: set ts=4 sw=4 expandtab: */
SDL_JoystickNameForIndex
DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index)
Definition: SDL_joystick.c:84
SDL_JoystickUpdate
DECLSPEC void SDLCALL SDL_JoystickUpdate(void)
Definition: SDL_joystick.c:657
SDL_JoystickNumBalls
DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick)
Definition: SDL_joystick.c:246
Sint32
int32_t Sint32
A signed 32-bit integer type.
Definition: SDL_stdinc.h:141
SDL_JoystickInstanceID
DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick)
Definition: SDL_joystick.c:372
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:116
SDL_JoystickGetAttached
DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick)
Definition: SDL_joystick.c:359
SDL_JoystickClose
DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick)
Definition: SDL_joystick.c:398
SDL_JoystickID
Sint32 SDL_JoystickID
Definition: SDL_joystick.h:72
SDL_JoystickGetDeviceGUID
DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index)
Definition: SDL_joystick.c:752
SDL_JoystickGetGUIDFromString
DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID)
Definition: SDL_joystick.c:824
DECLSPEC
#define DECLSPEC
Definition: begin_code.h:62
SDL_JoystickGetAxis
DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis)
Definition: SDL_joystick.c:270
SDLCALL
#define SDLCALL
Definition: begin_code.h:72
begin_code.h
SDL_JoystickGetButton
DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button)
Definition: SDL_joystick.c:338
close_code.h
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl2ext.h:848
SDL_JoystickGetBall
DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
Definition: SDL_joystick.c:310
SDL_stdinc.h
SDL_JoystickNumButtons
DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick)
Definition: SDL_joystick.c:258
SDL_JoystickEventState
DECLSPEC int SDLCALL SDL_JoystickEventState(int state)
Definition: SDL_joystick.c:708
SDL_JoystickGetGUIDString
DECLSPEC void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID)
Definition: SDL_joystick.c:770
SDL_JoystickName
DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick)
Definition: SDL_joystick.c:385
SDL_JoystickGetGUID
DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick)
Definition: SDL_joystick.c:764
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
SDL_JoystickNumHats
DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick)
Definition: SDL_joystick.c:234
SDL_JoystickGUID
Definition: SDL_joystick.h:68
Sint16
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:133
_SDL_Joystick
Definition: SDL_sysjoystick.h:29
SDL_JoystickOpen
DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index)
Definition: SDL_joystick.c:101
SDL_JoystickNumAxes
DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick)
Definition: SDL_joystick.c:222
SDL_error.h
SDL_JoystickGetHat
DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat)
Definition: SDL_joystick.c:290
SDL_NumJoysticks
DECLSPEC int SDLCALL SDL_NumJoysticks(void)
Definition: SDL_joystick.c:75