Skip to content

Commit

Permalink
fix support for old SDL versions
Browse files Browse the repository at this point in the history
Check for at least SDL 2.0.6 when using the
SDL_JoystickGetAxisInitialState() API introduced in e57beed.
  • Loading branch information
rkitover committed Dec 28, 2018
1 parent e57beed commit f8b5627
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wx/widgets/sdljoy.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit f8b5627

Please sign in to comment.