Added API for sensors on game controllers

Added support for the PS4 controller gyro and accelerometer on iOS and HIDAPI drivers

Also fixed an issue with the accelerometer on iOS having inverted axes
This commit is contained in:
Sam Lantinga 2020-11-17 10:30:20 -08:00
parent b79e1baa36
commit fcb21aa883
33 changed files with 810 additions and 118 deletions

View file

@ -782,3 +782,7 @@
#define SDL_crc32 SDL_crc32_REAL
#define SDL_GameControllerGetSerial SDL_GameControllerGetSerial_REAL
#define SDL_JoystickGetSerial SDL_JoystickGetSerial_REAL
#define SDL_GameControllerHasSensor SDL_GameControllerHasSensor_REAL
#define SDL_GameControllerSetSensorEnabled SDL_GameControllerSetSensorEnabled_REAL
#define SDL_GameControllerIsSensorEnabled SDL_GameControllerIsSensorEnabled_REAL
#define SDL_GameControllerGetSensorData SDL_GameControllerGetSensorData_REAL

View file

@ -843,3 +843,7 @@ SDL_DYNAPI_PROC(int,SDL_GameControllerGetTouchpadFinger,(SDL_GameController *a,
SDL_DYNAPI_PROC(Uint32,SDL_crc32,(Uint32 a, const void *b, size_t c),(a,b,c),return)
SDL_DYNAPI_PROC(const char*,SDL_GameControllerGetSerial,(SDL_GameController *a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_JoystickGetSerial,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerHasSensor,(SDL_GameController *a, SDL_SensorType b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_GameControllerSetSensorEnabled,(SDL_GameController *a, SDL_SensorType b, SDL_bool c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GameControllerIsSensorEnabled,(SDL_GameController *a, SDL_SensorType b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_GameControllerGetSensorData,(SDL_GameController *a, SDL_SensorType b, float *c, int d),(a,b,c,d),return)