working on game controller input
This commit is contained in:
@@ -186,6 +186,7 @@ bool Input::checkInput(Uint8 input, bool repeat)
|
|||||||
// Comprueba si hay un mando conectado
|
// Comprueba si hay un mando conectado
|
||||||
bool Input::discoverGameController()
|
bool Input::discoverGameController()
|
||||||
{
|
{
|
||||||
|
printf("%i joystics found", SDL_NumJoysticks());
|
||||||
for (int i = 0; i < SDL_NumJoysticks(); ++i)
|
for (int i = 0; i < SDL_NumJoysticks(); ++i)
|
||||||
{
|
{
|
||||||
if (SDL_IsGameController(i))
|
if (SDL_IsGameController(i))
|
||||||
@@ -232,7 +233,7 @@ bool Input::discoverGameController()
|
|||||||
//printf("%i buttons\n", SDL_JoystickNumButtons(mGameController));
|
//printf("%i buttons\n", SDL_JoystickNumButtons(mGameController));
|
||||||
|
|
||||||
// Obtiene el dispositivo de control háptico
|
// Obtiene el dispositivo de control háptico
|
||||||
/*mControllerHaptic = SDL_HapticOpenFromJoystick(mGameController);
|
mControllerHaptic = SDL_HapticOpenFromJoystick(mGameController);
|
||||||
if (mControllerHaptic == NULL)
|
if (mControllerHaptic == NULL)
|
||||||
{
|
{
|
||||||
printf("Warning: Controller does not support haptics!\nSDL Error: %s\n", SDL_GetError());
|
printf("Warning: Controller does not support haptics!\nSDL Error: %s\n", SDL_GetError());
|
||||||
|
|||||||
Reference in New Issue
Block a user