primer commit

This commit is contained in:
2025-04-08 08:23:18 +02:00
parent 94c89b7ced
commit b6682fe7ff
30 changed files with 18573 additions and 1 deletions

47
source/global_inputs.cpp Normal file
View File

@@ -0,0 +1,47 @@
#include "global_inputs.h"
#include <SDL3/SDL_keycode.h> // for SDLK_ESCAPE, SDLK_F1, SDLK_F2, SDLK_F3
#include "options.h" // for Options, OptionsLogo, options
#include "screen.h" // for Screen
namespace globalInputs
{
// Comprueba los inputs que se pueden introducir en cualquier sección del juego
void check(const SDL_Event &event)
{
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 0)
{
switch (event.key.key)
{
// Salir
case SDLK_ESCAPE:
options.logo.running = false;
return;
// Decrementar el tamaño de la ventana
case SDLK_F1:
Screen::get()->decWindowZoom();
return;
// Incrementar el tamaño de la ventana
case SDLK_F2:
Screen::get()->incWindowZoom();
return;
// Cambiar entre pantalla completa y ventana
case SDLK_F3:
Screen::get()->toggleFullscreen();
return;
// Integer Scale
case SDLK_F5:
Screen::get()->toggleIntegerScale();
return;
// VSync
case SDLK_F6:
Screen::get()->toggleVSync();
return;
}
}
}
}