include/SDL_joystick.h
branchSDL-1.2
changeset 4217 4c4113c2162c
parent 4159 a1b03ba2fcd0
child 6137 4720145f848b
     1.1 --- a/include/SDL_joystick.h	Mon Sep 21 09:27:08 2009 +0000
     1.2 +++ b/include/SDL_joystick.h	Mon Sep 21 09:38:10 2009 +0000
     1.3 @@ -20,7 +20,9 @@
     1.4      slouken@libsdl.org
     1.5  */
     1.6  
     1.7 -/* Include file for SDL joystick event handling */
     1.8 +/** @file SDL_joystick.h
     1.9 + *  Include file for SDL joystick event handling
    1.10 + */
    1.11  
    1.12  #ifndef _SDL_joystick_h
    1.13  #define _SDL_joystick_h
    1.14 @@ -34,97 +36,108 @@
    1.15  extern "C" {
    1.16  #endif
    1.17  
    1.18 -/* In order to use these functions, SDL_Init() must have been called
    1.19 -   with the SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
    1.20 -   for joysticks, and load appropriate drivers.
    1.21 -*/
    1.22 +/** @file SDL_joystick.h
    1.23 + *  @note In order to use these functions, SDL_Init() must have been called
    1.24 + *        with the SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
    1.25 + *        for joysticks, and load appropriate drivers.
    1.26 + */
    1.27  
    1.28 -/* The joystick structure used to identify an SDL joystick */
    1.29 +/** The joystick structure used to identify an SDL joystick */
    1.30  struct _SDL_Joystick;
    1.31  typedef struct _SDL_Joystick SDL_Joystick;
    1.32  
    1.33 -
    1.34  /* Function prototypes */
    1.35 -/*
    1.36 +/**
    1.37   * Count the number of joysticks attached to the system
    1.38   */
    1.39  extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
    1.40  
    1.41 -/*
    1.42 +/**
    1.43   * Get the implementation dependent name of a joystick.
    1.44 + *
    1.45   * This can be called before any joysticks are opened.
    1.46   * If no name can be found, this function returns NULL.
    1.47   */
    1.48  extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
    1.49  
    1.50 -/*
    1.51 - * Open a joystick for use - the index passed as an argument refers to
    1.52 +/**
    1.53 + * Open a joystick for use.
    1.54 + *
    1.55 + * @param[in] device_index
    1.56 + * The index passed as an argument refers to
    1.57   * the N'th joystick on the system.  This index is the value which will
    1.58   * identify this joystick in future joystick events.
    1.59   *
    1.60 - * This function returns a joystick identifier, or NULL if an error occurred.
    1.61 + * @return This function returns a joystick identifier, or NULL if an error occurred.
    1.62   */
    1.63  extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
    1.64  
    1.65 -/*
    1.66 +/**
    1.67   * Returns 1 if the joystick has been opened, or 0 if it has not.
    1.68   */
    1.69  extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
    1.70  
    1.71 -/*
    1.72 +/**
    1.73   * Get the device index of an opened joystick.
    1.74   */
    1.75  extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
    1.76  
    1.77 -/*
    1.78 +/**
    1.79   * Get the number of general axis controls on a joystick
    1.80   */
    1.81  extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
    1.82  
    1.83 -/*
    1.84 +/**
    1.85   * Get the number of trackballs on a joystick
    1.86 + *
    1.87   * Joystick trackballs have only relative motion events associated
    1.88   * with them and their state cannot be polled.
    1.89   */
    1.90  extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
    1.91  
    1.92 -/*
    1.93 +/**
    1.94   * Get the number of POV hats on a joystick
    1.95   */
    1.96  extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
    1.97  
    1.98 -/*
    1.99 +/**
   1.100   * Get the number of buttons on a joystick
   1.101   */
   1.102  extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
   1.103  
   1.104 -/*
   1.105 +/**
   1.106   * Update the current state of the open joysticks.
   1.107 + *
   1.108   * This is called automatically by the event loop if any joystick
   1.109   * events are enabled.
   1.110   */
   1.111  extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
   1.112  
   1.113 -/*
   1.114 +/**
   1.115   * Enable/disable joystick event polling.
   1.116 + *
   1.117   * If joystick events are disabled, you must call SDL_JoystickUpdate()
   1.118   * yourself and check the state of the joystick when you want joystick
   1.119   * information.
   1.120 - * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
   1.121 + *
   1.122 + * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
   1.123   */
   1.124  extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
   1.125  
   1.126 -/*
   1.127 +/**
   1.128   * Get the current state of an axis control on a joystick
   1.129 - * The state is a value ranging from -32768 to 32767.
   1.130 - * The axis indices start at index 0.
   1.131 + *
   1.132 + * @param[in] axis The axis indices start at index 0.
   1.133 + *
   1.134 + * @return The state is a value ranging from -32768 to 32767.
   1.135   */
   1.136  extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
   1.137  
   1.138 -/*
   1.139 - * Get the current state of a POV hat on a joystick
   1.140 - * The return value is one of the following positions:
   1.141 +/**
   1.142 + *  @name Hat Positions
   1.143 + *  The return value of SDL_JoystickGetHat() is one of the following positions:
   1.144   */
   1.145 +/*@{*/
   1.146  #define SDL_HAT_CENTERED	0x00
   1.147  #define SDL_HAT_UP		0x01
   1.148  #define SDL_HAT_RIGHT		0x02
   1.149 @@ -134,25 +147,32 @@
   1.150  #define SDL_HAT_RIGHTDOWN	(SDL_HAT_RIGHT|SDL_HAT_DOWN)
   1.151  #define SDL_HAT_LEFTUP		(SDL_HAT_LEFT|SDL_HAT_UP)
   1.152  #define SDL_HAT_LEFTDOWN	(SDL_HAT_LEFT|SDL_HAT_DOWN)
   1.153 -/*
   1.154 - * The hat indices start at index 0.
   1.155 +/*@}*/
   1.156 +
   1.157 +/** 
   1.158 + *  Get the current state of a POV hat on a joystick
   1.159 + *
   1.160 + *  @param[in] hat The hat indices start at index 0.
   1.161   */
   1.162  extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
   1.163  
   1.164 -/*
   1.165 +/**
   1.166   * Get the ball axis change since the last poll
   1.167 - * This returns 0, or -1 if you passed it invalid parameters.
   1.168 - * The ball indices start at index 0.
   1.169 + *
   1.170 + * @param[in] ball The ball indices start at index 0.
   1.171 + *
   1.172 + * @return This returns 0, or -1 if you passed it invalid parameters.
   1.173   */
   1.174  extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
   1.175  
   1.176 -/*
   1.177 +/**
   1.178   * Get the current state of a button on a joystick
   1.179 - * The button indices start at index 0.
   1.180 + *
   1.181 + * @param[in] button The button indices start at index 0.
   1.182   */
   1.183  extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
   1.184  
   1.185 -/*
   1.186 +/**
   1.187   * Close a joystick previously opened with SDL_JoystickOpen()
   1.188   */
   1.189  extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);