include/SDL_gamecontroller.h
changeset 6873 f042ae287155
parent 6871 bd681c870ccf
child 6885 700f1b25f77f
     1.1 --- a/include/SDL_gamecontroller.h	Tue Feb 12 22:23:42 2013 -0800
     1.2 +++ b/include/SDL_gamecontroller.h	Wed Feb 13 17:19:21 2013 -0800
     1.3 @@ -21,7 +21,7 @@
     1.4  
     1.5  /**
     1.6   *  \file SDL_gamecontroller.h
     1.7 - *  
     1.8 + *
     1.9   *  Include file for SDL game controller event handling
    1.10   */
    1.11  
    1.12 @@ -53,7 +53,7 @@
    1.13  typedef struct _SDL_GameController SDL_GameController;
    1.14  
    1.15  
    1.16 -typedef enum 
    1.17 +typedef enum
    1.18  {
    1.19  	SDL_CONTROLLER_BINDTYPE_NONE = 0,
    1.20  	SDL_CONTROLLER_BINDTYPE_BUTTON,
    1.21 @@ -97,7 +97,7 @@
    1.22   *
    1.23   *  Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
    1.24   *  Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
    1.25 - *	The mapping format for joystick is: 
    1.26 + *	The mapping format for joystick is:
    1.27   *		bX - a joystick button, index X
    1.28   *		hX.Y - hat X with value Y
    1.29   *		aX - axis X of the joystick
    1.30 @@ -111,7 +111,6 @@
    1.31  
    1.32  /**
    1.33   *  Is the joystick on this index supported by the game controller interface?
    1.34 - *		returns 1 if supported, 0 otherwise.
    1.35   */
    1.36  extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
    1.37  
    1.38 @@ -124,11 +123,11 @@
    1.39  extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
    1.40  
    1.41  /**
    1.42 - *  Open a game controller for use.  
    1.43 - *  The index passed as an argument refers to the N'th game controller on the system.  
    1.44 + *  Open a game controller for use.
    1.45 + *  The index passed as an argument refers to the N'th game controller on the system.
    1.46   *  This index is the value which will identify this controller in future controller
    1.47   *  events.
    1.48 - *  
    1.49 + *
    1.50   *  \return A controller identifier, or NULL if an error occurred.
    1.51   */
    1.52  extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
    1.53 @@ -136,25 +135,26 @@
    1.54  /**
    1.55   *  Return the name for this currently opened controller
    1.56   */
    1.57 -extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController * gamecontroller);
    1.58 -	
    1.59 +extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
    1.60 +
    1.61  /**
    1.62 - *  Returns 1 if the controller has been opened and currently connected, or 0 if it has not.
    1.63 + *  Returns SDL_TRUE if the controller has been opened and currently connected,
    1.64 + *  or SDL_FALSE if it has not.
    1.65   */
    1.66 -extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController * gamecontroller);
    1.67 +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
    1.68  
    1.69  /**
    1.70   *  Get the underlying joystick object used by a controller
    1.71   */
    1.72 -extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController * gamecontroller);
    1.73 +extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
    1.74  
    1.75  /**
    1.76   *  Enable/disable controller event polling.
    1.77 - *  
    1.78 + *
    1.79   *  If controller events are disabled, you must call SDL_GameControllerUpdate()
    1.80   *  yourself and check the state of the controller when you want controller
    1.81   *  information.
    1.82 - *  
    1.83 + *
    1.84   *  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
    1.85   */
    1.86  extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
    1.87 @@ -162,7 +162,7 @@
    1.88  /**
    1.89   *  The list of axii available from a controller
    1.90   */
    1.91 -typedef enum 
    1.92 +typedef enum
    1.93  {
    1.94  	SDL_CONTROLLER_AXIS_INVALID = -1,
    1.95  	SDL_CONTROLLER_AXIS_LEFTX,
    1.96 @@ -182,17 +182,20 @@
    1.97  /**
    1.98   *  get the sdl joystick layer binding for this controller button mapping
    1.99   */
   1.100 -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForAxis(SDL_GameController * gamecontroller, SDL_CONTROLLER_AXIS button);
   1.101 +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
   1.102 +SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
   1.103 +                                 SDL_CONTROLLER_AXIS button);
   1.104  
   1.105  /**
   1.106   *  Get the current state of an axis control on a game controller.
   1.107 - *  
   1.108 + *
   1.109   *  The state is a value ranging from -32768 to 32767.
   1.110 - *  
   1.111 + *
   1.112   *  The axis indices start at index 0.
   1.113   */
   1.114 -extern DECLSPEC Sint16 SDLCALL SDL_GameControllerGetAxis(SDL_GameController * gamecontroller,
   1.115 -                                                   SDL_CONTROLLER_AXIS axis);
   1.116 +extern DECLSPEC Sint16 SDLCALL
   1.117 +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller,
   1.118 +                          SDL_CONTROLLER_AXIS axis);
   1.119  
   1.120  /**
   1.121   *  The list of buttons available from a controller
   1.122 @@ -227,21 +230,23 @@
   1.123  /**
   1.124   *  get the sdl joystick layer binding for this controller button mapping
   1.125   */
   1.126 -extern DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForButton(SDL_GameController * gamecontroller, SDL_CONTROLLER_BUTTON button);
   1.127 +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
   1.128 +SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
   1.129 +                                   SDL_CONTROLLER_BUTTON button);
   1.130  
   1.131  
   1.132  /**
   1.133   *  Get the current state of a button on a game controller.
   1.134 - *  
   1.135 + *
   1.136   *  The button indices start at index 0.
   1.137   */
   1.138 -extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController * gamecontroller,
   1.139 -                                                    SDL_CONTROLLER_BUTTON button);
   1.140 +extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
   1.141 +                                                          SDL_CONTROLLER_BUTTON button);
   1.142  
   1.143  /**
   1.144   *  Close a controller previously opened with SDL_GameControllerOpen().
   1.145   */
   1.146 -extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController * gamecontrollerk);
   1.147 +extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
   1.148  
   1.149  
   1.150  /* Ends C function definitions when using C++ */