Skip to content

Commit

Permalink
Gamepads: initialize data after SDL is loaded
Browse files Browse the repository at this point in the history
otherwise the logging in the constructor won't find any gamepads
  • Loading branch information
univrsal committed Aug 11, 2024
1 parent ca087a9 commit c339351
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/hook/gamepad_hook_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ void start()
*/

state = true;
local_gamepads = new gamepads;
if (!WIN32)
if (!WIN32) {
sdl_init();
local_gamepads = new gamepads;
}

sdl_poll_thread = std::thread([] {
if (WIN32)
if (WIN32) {
sdl_init();
local_gamepads = new gamepads;
}

local_gamepads->event_loop();
if (WIN32)
sdl_deinit();
Expand Down

0 comments on commit c339351

Please sign in to comment.