working on game controller input
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "input.h"
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
|
||||
// Constructor
|
||||
Input::Input(int source)
|
||||
@@ -185,16 +186,16 @@ bool Input::checkInput(Uint8 input, bool repeat)
|
||||
// Comprueba si hay un mando conectado
|
||||
bool Input::discoverGameController()
|
||||
{
|
||||
if (SDL_NumJoysticks() < 1)
|
||||
/*if (SDL_NumJoysticks() < 1)
|
||||
{
|
||||
printf("Warning: No joysticks connected!\n");
|
||||
mGameControllerFound = false;
|
||||
std::cout << "Warning: No joysticks connected!\n";
|
||||
}
|
||||
else
|
||||
else*/
|
||||
{
|
||||
// Carga el mando
|
||||
mGameController = SDL_GameControllerOpen(0);
|
||||
mGameControllerFound = true;
|
||||
|
||||
if (mGameController == NULL)
|
||||
{
|
||||
@@ -204,6 +205,9 @@ bool Input::discoverGameController()
|
||||
else
|
||||
{
|
||||
printf("%i joysticks were found.\n", SDL_NumJoysticks());
|
||||
std::cout << "joysticks were found!\n";
|
||||
mGameControllerFound = true;
|
||||
|
||||
//printf("%i buttons\n", SDL_JoystickNumButtons(mGameController));
|
||||
|
||||
// Obtiene el dispositivo de control háptico
|
||||
|
||||
Reference in New Issue
Block a user