fix support for old SDL versions

Check for at least SDL 2.0.6 when using the
SDL_JoystickGetAxisInitialState() API introduced in e57beed8.
This commit is contained in:
Rafael Kitover 2018-12-28 05:22:17 -08:00
parent e57beed890
commit f8b5627bd8
1 changed files with 2 additions and 0 deletions

View File

@ -135,9 +135,11 @@ void wxSDLJoy::Notify()
val = SDL_JoystickGetAxis(dev, j);
// trigger axes always return max negative value, we ignore these
#if SDL_VERSION_ATLEAST(2, 0, 6)
int16_t initial_state;
if (SDL_JoystickGetAxisInitialState(dev, j, &initial_state) && val == initial_state)
continue;
#endif
if (digital) {
if (val > 0x3fff)