migrant a SDL3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_events.h> // Para SDL_ControllerButtonEvent
|
||||
#include <SDL2/SDL_gamecontroller.h> // Para SDL_GameControllerButton
|
||||
#include <SDL3/SDL_events.h> // Para SDL_ControllerButtonEvent
|
||||
#include <SDL3/SDL.h> // Para SDL_GamepadButton
|
||||
#include <stddef.h> // Para size_t
|
||||
#include <memory> // Para shared_ptr, unique_ptr
|
||||
#include <string> // Para string
|
||||
@@ -14,10 +14,10 @@ struct DefineButtonsButton
|
||||
{
|
||||
std::string label; // Texto en pantalla para el botón
|
||||
InputAction input; // Input asociado
|
||||
SDL_GameControllerButton button; // Botón del mando correspondiente
|
||||
SDL_GamepadButton button; // Botón del mando correspondiente
|
||||
|
||||
// Constructor
|
||||
DefineButtonsButton(const std::string &lbl, InputAction inp, SDL_GameControllerButton btn)
|
||||
DefineButtonsButton(const std::string &lbl, InputAction inp, SDL_GamepadButton btn)
|
||||
: label(lbl), input(inp), button(btn) {}
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
void incIndexButton();
|
||||
|
||||
// Comprueba el botón que se ha pulsado
|
||||
void doControllerButtonDown(const SDL_ControllerButtonEvent &event);
|
||||
void doControllerButtonDown(const SDL_GamepadButtonEvent &event);
|
||||
|
||||
// Asigna los botones definidos al input
|
||||
void bindButtons();
|
||||
@@ -51,7 +51,7 @@ private:
|
||||
void saveBindingsToOptions();
|
||||
|
||||
// Comprueba que un botón no esté ya asignado
|
||||
bool checkButtonNotInUse(SDL_GameControllerButton button);
|
||||
bool checkButtonNotInUse(SDL_GamepadButton button);
|
||||
|
||||
// Limpia la asignación de botones
|
||||
void clearButtons();
|
||||
|
||||
Reference in New Issue
Block a user