Removed SDL_HasGamepads(), SDL_HasJoysticks(), and SDL_HasSensors()

Also cleaned up logic for whether we need to poll for events:
- We need to periodically poll for joysticks to handle hotplug.
- We need to frequently poll for joysticks and sensors when they're open so their state can be updated
This commit is contained in:
Sam Lantinga
2022-12-29 23:07:30 -08:00
parent 7f23d71b6a
commit 324c0b76a0
15 changed files with 64 additions and 153 deletions

View File

@@ -274,17 +274,6 @@ extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID gui
*/
extern DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
/**
* Return whether there are gamepads connected
*
* \returns SDL_TRUE if there are gamepads connected, SDL_FALSE otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetGamepads
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasGamepads(void);
/**
* Get a list of currently connected gamepads.
*

View File

@@ -136,17 +136,6 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lo
*/
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
/**
* Return whether there are joysticks connected
*
* \returns SDL_TRUE if there are joysticks connected, SDL_FALSE otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetJoysticks
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasJoysticks(void);
/**
* Get a list of currently connected joysticks.
*

View File

@@ -128,17 +128,6 @@ typedef enum
/* Function prototypes */
/**
* Return whether there are sensors connected
*
* \returns SDL_TRUE if there are sensors connected, SDL_FALSE otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetSensors
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSensors(void);
/**
* Get a list of currently connected sensors.
*