singletons

This commit is contained in:
2026-04-17 21:27:30 +02:00
parent 5889df2a47
commit 513eacf356
27 changed files with 536 additions and 505 deletions

View File

@@ -79,10 +79,18 @@ class Input {
// Construye el nombre visible de un mando (name truncado + sufijo #N)
std::string buildControllerName(SDL_Gamepad *pad, int padIndex);
public:
// Constructor
// Constructor privado (usar Input::init)
Input(std::string file);
// Instancia única
static Input *instance;
public:
// Singleton API
static void init(const std::string &gameControllerDbPath); // Crea la instancia
static void destroy(); // Libera la instancia
static auto get() -> Input *; // Obtiene el puntero a la instancia
// Destructor
~Input();