zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_gamecontroller.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 
28 #ifndef _SDL_gamecontroller_h
29 #define _SDL_gamecontroller_h
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_joystick.h"
34 
35 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
53 /* The gamecontroller structure used to identify an SDL game controller */
54 struct _SDL_GameController;
55 typedef struct _SDL_GameController SDL_GameController;
56 
57 
58 typedef enum
59 {
65 
70 {
72  union
73  {
74  int button;
75  int axis;
76  struct {
77  int hat;
78  int hat_mask;
79  } hat;
80  } value;
81 
83 
84 
116 extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString );
117 
124 
130 extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller );
131 
135 extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
136 
137 
143 extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
144 
153 extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
154 
158 extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
159 
165 
170 
180 extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
181 
188 extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
189 
190 
194 typedef enum
195 {
205 
210 
215 
222 
230 extern DECLSPEC Sint16 SDLCALL
233 
237 typedef enum
238 {
257 
262 
267 
273  SDL_GameControllerButton button);
274 
275 
282  SDL_GameControllerButton button);
283 
287 extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
288 
289 
290 /* Ends C function definitions when using C++ */
291 #ifdef __cplusplus
292 }
293 #endif
294 #include "close_code.h"
295 
296 #endif /* _SDL_gamecontroller_h */
297 
298 /* vi: set ts=4 sw=4 expandtab: */
DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller)
SDL_GameControllerBindType
DECLSPEC void SDLCALL SDL_GameControllerUpdate(void)
DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString)
struct _SDL_GameController SDL_GameController
SDL_bool
Definition: SDL_stdinc.h:116
DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index)
#define DECLSPEC
Definition: begin_code.h:62
union SDL_GameControllerButtonBind::@64 value
DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index)
DECLSPEC int SDLCALL SDL_GameControllerEventState(int state)
#define SDLCALL
Definition: begin_code.h:72
SDL_GameControllerButton
DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index)
DECLSPEC const char *SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button)
DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString)
DECLSPEC const char *SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis)
SDL_GameControllerBindType bindType
DECLSPEC Sint16 SDLCALL SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
DECLSPEC char *SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller)
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller)
DECLSPEC char *SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
int16_t Sint16
A signed 16-bit integer type.
Definition: SDL_stdinc.h:133
DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char *mappingString)
struct SDL_GameControllerButtonBind SDL_GameControllerButtonBind
DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller)
DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
SDL_GameControllerAxis
DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller)