singletons
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user