Skip to content

Commit

Permalink
check sdl ver
Browse files Browse the repository at this point in the history
for emscripten
  • Loading branch information
Daft-Freak committed Jan 24, 2025
1 parent 22b2479 commit 739b7aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 32blit-sdl/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ void Input::_add_controller(SDL_GameController* gc) {
// welcome rumble to test if it can rumble
auto can_rumble = SDL_GameControllerRumble(gc, 0xFFFF, 0xFFFF, 200);

#if SDL_VERSION_ATLEAST(2, 0, 14)
// enable accelerometer if present
SDL_GameControllerSetSensorEnabled(gc, SDL_SENSOR_ACCEL, SDL_TRUE);
#endif

GameController gcs = {gc, can_rumble == 0};
game_controllers.push_back(gcs);
Expand Down

0 comments on commit 739b7aa

Please sign in to comment.