Enabled ImGui navigation with keyboard and game controller.
Ref issue #92.
This commit is contained in:
1 parent
8ab50ea7b7
commit
200a7dbf79
2 files changed
+12
-3
No files matched your search
@@ -379,7 +379,9 @@ static void ImGui_ImplSDL2_UpdateGamepads()
|
||||
return;
|
||||
|
||||
// Get gamepad
|
||||
SDL_GameController* game_controller = SDL_GameControllerOpen(0);
|
||||
SDL_GameController* game_controller = nullptr;
|
||||
if (SDL_NumJoysticks() > 0 && SDL_IsGameController(0))
|
||||
game_controller = SDL_GameControllerOpen(0);
|
||||
if (!game_controller)
|
||||
{
|
||||
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;
|
||||
|
||||
Reference in new issue
Block a user