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:
parent
e57beed890
commit
f8b5627bd8
|
@ -135,9 +135,11 @@ void wxSDLJoy::Notify()
|
||||||
val = SDL_JoystickGetAxis(dev, j);
|
val = SDL_JoystickGetAxis(dev, j);
|
||||||
|
|
||||||
// trigger axes always return max negative value, we ignore these
|
// trigger axes always return max negative value, we ignore these
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 6)
|
||||||
int16_t initial_state;
|
int16_t initial_state;
|
||||||
if (SDL_JoystickGetAxisInitialState(dev, j, &initial_state) && val == initial_state)
|
if (SDL_JoystickGetAxisInitialState(dev, j, &initial_state) && val == initial_state)
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (digital) {
|
if (digital) {
|
||||||
if (val > 0x3fff)
|
if (val > 0x3fff)
|
||||||
|
|
Loading…
Reference in New Issue