Singletonejada la classe Input

This commit is contained in:
2024-09-28 14:19:00 +02:00
parent fa82758ce1
commit 2767696a3f
19 changed files with 87 additions and 44 deletions

View File

@@ -63,6 +63,9 @@ enum i_disable_e
class Input
{
private:
// [SINGLETON] Objeto screen privado para Don Melitón
static Input *input;
struct keyBindings_t
{
Uint8 scancode; // Scancode asociado
@@ -93,10 +96,22 @@ private:
// Comprueba el eje del mando
bool checkAxisInput(inputs_e input, int index = 0);
public:
// Constructor
Input(std::string file);
// Destructor
~Input();
public:
// [SINGLETON] Crearemos el objeto screen con esta función estática
static void init(std::string file);
// [SINGLETON] Destruiremos el objeto screen con esta función estática
static void destroy();
// [SINGLETON] Con este método obtenemos el objeto screen y podemos trabajar con él
static Input *get();
// Actualiza el estado del objeto
void update();