Guard SDL_ControllerSensorEvent usage by SDL version check
This commit is contained in:
parent
fd41226cdd
commit
e516943d53
1 changed files with 2 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ struct GamepadState {
|
||||||
SDL_TimerID mouseEmulationTimer;
|
SDL_TimerID mouseEmulationTimer;
|
||||||
uint32_t lastStartDownTime;
|
uint32_t lastStartDownTime;
|
||||||
|
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 14)
|
||||||
uint8_t gyroReportPeriodMs;
|
uint8_t gyroReportPeriodMs;
|
||||||
float lastGyroEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)];
|
float lastGyroEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)];
|
||||||
uint32_t lastGyroEventTime;
|
uint32_t lastGyroEventTime;
|
||||||
|
|
@ -26,6 +27,7 @@ struct GamepadState {
|
||||||
uint8_t accelReportPeriodMs;
|
uint8_t accelReportPeriodMs;
|
||||||
float lastAccelEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)];
|
float lastAccelEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)];
|
||||||
uint32_t lastAccelEventTime;
|
uint32_t lastAccelEventTime;
|
||||||
|
#endif
|
||||||
|
|
||||||
int buttons;
|
int buttons;
|
||||||
short lsX, lsY;
|
short lsX, lsY;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue