orx  stable
Portable Game Engine
orxJoystick.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
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  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxJOYSTICK_H_
44 #define _orxJOYSTICK_H_
45 
46 #include "orxInclude.h"
47 #include "plugin/orxPluginCore.h"
48 
49 
52 #define orxJOYSTICK_GET_AXIS_FOR_PLAYER(AXIS, PLAYER) (((AXIS) % orxJOYSTICK_AXIS_SINGLE_NUMBER) + ((PLAYER - 1) * orxJOYSTICK_AXIS_SINGLE_NUMBER))
53 #define orxJOYSTICK_GET_BUTTON_FOR_PLAYER(BUTTON, PLAYER) (((BUTTON) % orxJOYSTICK_BUTTON_SINGLE_NUMBER) + ((PLAYER - 1) * orxJOYSTICK_BUTTON_SINGLE_NUMBER))
54 
55 #define orxJOYSTICK_GET_PLAYER_FROM_AXIS(AXIS) (((AXIS) / orxJOYSTICK_AXIS_SINGLE_NUMBER) + 1)
56 #define orxJOYSTICK_GET_PLAYER_FROM_BUTTON(BUTTON) (((BUTTON) / orxJOYSTICK_BUTTON_SINGLE_NUMBER) + 1)
57 
58 
61 typedef enum __orxJOYSTICK_BUTTON_t
62 {
79 
81 
98 
115 
132 
134 
135  orxJOYSTICK_BUTTON_NONE = orxENUM_NONE
136 
138 
139 
142 typedef enum __orxJOYSTICK_AXIS_t
143 {
151 
153 
161 
169 
177 
179 
180  orxJOYSTICK_AXIS_NONE = orxENUM_NONE
181 
183 
184 
185 /***************************************************************************
186  * Functions directly implemented by orx core
187  ***************************************************************************/
188 
191 extern orxDLLAPI void orxFASTCALL orxJoystick_Setup();
192 
193 
194 /***************************************************************************
195  * Functions extended by plugins
196  ***************************************************************************/
197 
201 extern orxDLLAPI orxSTATUS orxFASTCALL orxJoystick_Init();
202 
205 extern orxDLLAPI void orxFASTCALL orxJoystick_Exit();
206 
211 extern orxDLLAPI orxFLOAT orxFASTCALL orxJoystick_GetAxisValue(orxJOYSTICK_AXIS _eAxis);
212 
217 extern orxDLLAPI orxBOOL orxFASTCALL orxJoystick_IsButtonPressed(orxJOYSTICK_BUTTON _eButton);
218 
223 extern orxDLLAPI const orxSTRING orxFASTCALL orxJoystick_GetButtonName(orxJOYSTICK_BUTTON _eButton);
224 
229 extern orxDLLAPI const orxSTRING orxFASTCALL orxJoystick_GetAxisName(orxJOYSTICK_AXIS _eAxis);
230 
231 #endif /* _orxJOYSTICK_H_ */
232 
orxJOYSTICK_AXIS
Definition: orxJoystick.h:142
orxDLLAPI void orxFASTCALL orxJoystick_Setup()
orxDLLAPI const orxSTRING orxFASTCALL orxJoystick_GetButtonName(orxJOYSTICK_BUTTON _eButton)
orxDLLAPI void orxFASTCALL orxJoystick_Exit()
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxFLOAT orxFASTCALL orxJoystick_GetAxisValue(orxJOYSTICK_AXIS _eAxis)
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxBOOL orxFASTCALL orxJoystick_IsButtonPressed(orxJOYSTICK_BUTTON _eButton)
orxJOYSTICK_BUTTON
Definition: orxJoystick.h:61
orxDLLAPI orxSTATUS orxFASTCALL orxJoystick_Init()
orxDLLAPI const orxSTRING orxFASTCALL orxJoystick_GetAxisName(orxJOYSTICK_AXIS _eAxis)

Generated for orx by doxygen 1.5.6