Guard SDL_ControllerSensorEvent usage by SDL version check

This commit is contained in:
Cameron Gutman 2023-09-12 18:10:06 -05:00
parent fd41226cdd
commit e516943d53

View file

@ -19,6 +19,7 @@ struct GamepadState {
SDL_TimerID mouseEmulationTimer;
uint32_t lastStartDownTime;
#if SDL_VERSION_ATLEAST(2, 0, 14)
uint8_t gyroReportPeriodMs;
float lastGyroEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)];
uint32_t lastGyroEventTime;
@ -26,6 +27,7 @@ struct GamepadState {
uint8_t accelReportPeriodMs;
float lastAccelEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)];
uint32_t lastAccelEventTime;
#endif
int buttons;
short lsX, lsY;