migracio a SDL3

This commit is contained in:
2026-04-03 10:04:49 +02:00
parent 1e73a3159f
commit 7e570e2814
44 changed files with 826 additions and 801 deletions

View File

@@ -1,8 +1,6 @@
#pragma once
#include <SDL2/SDL_gamecontroller.h> // for SDL_GameControllerButton, SDL_G...
#include <SDL2/SDL_scancode.h> // for SDL_Scancode
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <SDL3/SDL.h>
#include <string> // for string, basic_string
#include <vector> // for vector
@@ -58,12 +56,12 @@ private:
struct GameControllerBindings_t
{
SDL_GameControllerButton button; // GameControllerButton asociado
SDL_GamepadButton button; // GameControllerButton asociado
bool active; // Indica si está activo
};
// Objetos y punteros
std::vector<SDL_GameController *> connectedControllers; // Vector con todos los mandos conectados
std::vector<SDL_Gamepad *> connectedControllers; // Vector con todos los mandos conectados
// Variables
std::vector<keyBindings_t> keyBindings; // Vector con las teclas asociadas a los inputs predefinidos
@@ -86,7 +84,7 @@ public:
void bindKey(Uint8 input, SDL_Scancode code);
// Asigna inputs a botones del mando
void bindGameControllerButton(Uint8 input, SDL_GameControllerButton button);
void bindGameControllerButton(Uint8 input, SDL_GamepadButton button);
// Comprueba si un input esta activo
bool checkInput(Uint8 input, bool repeat = true, int device = INPUT_USE_ANY, int index = 0);