summaryrefslogtreecommitdiff
path: root/include/SDL_joystick.h
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2013-05-18 14:17:52 -0700
committerSam Lantinga <slouken@libsdl.org>2013-05-18 14:17:52 -0700
commitb80d20fb1100c64799769dbc0ef67582dcf29e31 (patch)
tree351258ecef703d638c01d1e629af4adc22a31994 /include/SDL_joystick.h
parent220d178aad1719aabbf6e2dd0bebcedba0abc951 (diff)
downloadsdl-b80d20fb1100c64799769dbc0ef67582dcf29e31.tar.gz
File style cleanup for the SDL 2.0 release
Diffstat (limited to 'include/SDL_joystick.h')
-rw-r--r--include/SDL_joystick.h56
1 files changed, 26 insertions, 30 deletions
diff --git a/include/SDL_joystick.h b/include/SDL_joystick.h
index c948c05b3..f568f9bd8 100644
--- a/include/SDL_joystick.h
+++ b/include/SDL_joystick.h
@@ -21,7 +21,7 @@
/**
* \file SDL_joystick.h
- *
+ *
* Include file for SDL joystick event handling
*
* The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks, with the exact joystick
@@ -30,7 +30,7 @@
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
* then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
*
- * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
+ * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
* the device (a X360 wired controller for example). This identifier is platform dependent.
*
*
@@ -45,9 +45,7 @@
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
-/* *INDENT-OFF* */
extern "C" {
-/* *INDENT-ON* */
#endif
/**
@@ -64,7 +62,7 @@ typedef struct _SDL_Joystick SDL_Joystick;
/* A structure that encodes the stable unique id for a joystick device */
typedef struct {
- Uint8 data[16];
+ Uint8 data[16];
} SDL_JoystickGUID;
typedef Sint32 SDL_JoystickID;
@@ -84,11 +82,11 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
/**
- * Open a joystick for use.
- * The index passed as an argument refers tothe N'th joystick on the system.
+ * Open a joystick for use.
+ * The index passed as an argument refers tothe N'th joystick on the system.
* This index is the value which will identify this joystick in future joystick
* events.
- *
+ *
* \return A joystick identifier, or NULL if an error occurred.
*/
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
@@ -98,7 +96,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
* If no name can be found, this function returns NULL.
*/
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
-
+
/**
* Return the GUID for the joystick at this index
*/
@@ -137,7 +135,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick);
/**
* Get the number of trackballs on a joystick.
- *
+ *
* Joystick trackballs have only relative motion events associated
* with them and their state cannot be polled.
*/
@@ -155,7 +153,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick);
/**
* Update the current state of the open joysticks.
- *
+ *
* This is called automatically by the event loop if any joystick
* events are enabled.
*/
@@ -163,20 +161,20 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
/**
* Enable/disable joystick event polling.
- *
+ *
* If joystick events are disabled, you must call SDL_JoystickUpdate()
* yourself and check the state of the joystick when you want joystick
* information.
- *
+ *
* The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
*/
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
/**
* Get the current state of an axis control on a joystick.
- *
+ *
* The state is a value ranging from -32768 to 32767.
- *
+ *
* The axis indices start at index 0.
*/
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
@@ -186,22 +184,22 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
* \name Hat positions
*/
/*@{*/
-#define SDL_HAT_CENTERED 0x00
-#define SDL_HAT_UP 0x01
-#define SDL_HAT_RIGHT 0x02
-#define SDL_HAT_DOWN 0x04
-#define SDL_HAT_LEFT 0x08
-#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
-#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
-#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
-#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
+#define SDL_HAT_CENTERED 0x00
+#define SDL_HAT_UP 0x01
+#define SDL_HAT_RIGHT 0x02
+#define SDL_HAT_DOWN 0x04
+#define SDL_HAT_LEFT 0x08
+#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
+#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
+#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
+#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
/*@}*/
/**
* Get the current state of a POV hat on a joystick.
*
* The hat indices start at index 0.
- *
+ *
* \return The return value is one of the following positions:
* - ::SDL_HAT_CENTERED
* - ::SDL_HAT_UP
@@ -218,9 +216,9 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick,
/**
* Get the ball axis change since the last poll.
- *
+ *
* \return 0, or -1 if you passed it invalid parameters.
- *
+ *
* The ball indices start at index 0.
*/
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick,
@@ -228,7 +226,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick,
/**
* Get the current state of a button on a joystick.
- *
+ *
* The button indices start at index 0.
*/
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick,
@@ -242,9 +240,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
-/* *INDENT-OFF* */
}
-/* *INDENT-ON* */
#endif
#include "close_code.h"