Dual input for P1 done

This commit is contained in:
2021-08-29 22:03:48 +02:00
parent 02b528ea8c
commit 224b176108
9 changed files with 113 additions and 137 deletions

View File

@@ -28,6 +28,7 @@
#define INPUT_USE_KEYBOARD 0
#define INPUT_USE_GAMECONTROLLER 1
#define INPUT_USE_ANY 2
// Clase Input
class Input
@@ -52,14 +53,12 @@ private:
std::vector<SDL_GameController*> mConnectedControllers;
int mNumGamepads;
int mSource; // Indica si el objeto usará un mando o un teclado
// Comprueba si hay un mando conectado
bool discoverGameController();
public:
// Constructor
Input(int source);
Input();
// Destructor
~Input();
@@ -71,10 +70,7 @@ public:
void bindGameController(Uint8 input, SDL_GameControllerButton button);
// Comprueba si un input esta activo
bool checkInput(Uint8 input, bool repeat);
// Establece el método de entrada
void setSource(Uint8 value);
bool checkInput(Uint8 input, bool repeat, int device=INPUT_USE_ANY);
};
#endif