From 23d9bb0e3d64124ca72e3f4d11d0164775495610 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 24 Aug 2021 20:15:20 +0200 Subject: [PATCH] working on game controller input --- source/input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/input.cpp b/source/input.cpp index 04e4283..1cf74ad 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -186,6 +186,7 @@ bool Input::checkInput(Uint8 input, bool repeat) // Comprueba si hay un mando conectado bool Input::discoverGameController() { + printf("%i joystics found", SDL_NumJoysticks()); for (int i = 0; i < SDL_NumJoysticks(); ++i) { if (SDL_IsGameController(i)) @@ -232,7 +233,7 @@ bool Input::discoverGameController() //printf("%i buttons\n", SDL_JoystickNumButtons(mGameController)); // Obtiene el dispositivo de control háptico - /*mControllerHaptic = SDL_HapticOpenFromJoystick(mGameController); + mControllerHaptic = SDL_HapticOpenFromJoystick(mGameController); if (mControllerHaptic == NULL) { printf("Warning: Controller does not support haptics!\nSDL Error: %s\n", SDL_GetError());