From 3440dea0a55a6c56fb4abec2c857f56efbd304c9 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Wed, 25 Aug 2021 13:34:40 +0200 Subject: [PATCH] working on game controller --- source/input.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/input.cpp b/source/input.cpp index 0cd04a0..fd3a070 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -261,8 +261,11 @@ bool Input::discoverGameController() // Open the controller and add it to our list mGameController = SDL_GameControllerOpen(i); if (SDL_GameControllerGetAttached(mGameController) == 1) - //connectedControllers.push_back(pad); + //connectedControllers.push_back(pad); + { found = true; + printf("%s\n", SDL_GameControllerNameForIndex(i)); + } else std::cout << "SDL_GetError() = " << SDL_GetError() << std::endl; }