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

@@ -37,6 +37,9 @@ extern void SDL_QuitSensors(void);
extern void SDL_LockSensors(void);
extern void SDL_UnlockSensors(void);
/* Function to return whether there are any sensors opened by the application */
extern SDL_bool SDL_SensorsOpened(void);
/* Internal event queueing functions */
extern int SDL_SendSensorUpdate(Uint64 timestamp, SDL_Sensor *sensor, Uint64 sensor_timestamp, float *data, int num_values);