Added SDL_GameControllerGetSensorDataRate() to get the sensor update rate for a controller.

This commit is contained in:
Sam Lantinga 2021-07-29 06:43:39 -07:00
parent ce8261dd6d
commit a186a503e7
12 changed files with 88 additions and 71 deletions

View file

@ -758,6 +758,15 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameControlle
*/
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type);
/**
* Get the data rate (number of events per second) of a game controller sensor.
*
* \param gamecontroller The controller to query
* \param type The type of sensor to query
* \return the data rate, or 0.0f if the data rate is not available.
*/
extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type);
/**
* Get the current state of a game controller sensor.
*