primer commit
This commit is contained in:
47
source/global_inputs.cpp
Normal file
47
source/global_inputs.cpp
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user