43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#include "core/input/global_inputs.hpp"
|
|
|
|
#include "core/input/input.h"
|
|
#include "core/rendering/screen.h"
|
|
|
|
namespace GlobalInputs {
|
|
|
|
auto handle(Screen *screen, Input *input) -> bool {
|
|
if (screen == nullptr || input == nullptr) { return false; }
|
|
|
|
if (input->checkInput(input_window_fullscreen, REPEAT_FALSE)) {
|
|
screen->toggleVideoMode();
|
|
return true;
|
|
}
|
|
if (input->checkInput(input_window_dec_size, REPEAT_FALSE)) {
|
|
screen->decWindowZoom();
|
|
return true;
|
|
}
|
|
if (input->checkInput(input_window_inc_size, REPEAT_FALSE)) {
|
|
screen->incWindowZoom();
|
|
return true;
|
|
}
|
|
if (input->checkInput(input_prev_preset, REPEAT_FALSE)) {
|
|
screen->prevPreset();
|
|
return true;
|
|
}
|
|
if (input->checkInput(input_next_preset, REPEAT_FALSE)) {
|
|
screen->nextPreset();
|
|
return true;
|
|
}
|
|
if (input->checkInput(input_toggle_shader, REPEAT_FALSE)) {
|
|
screen->toggleShaderEnabled();
|
|
return true;
|
|
}
|
|
if (input->checkInput(input_toggle_shader_type, REPEAT_FALSE)) {
|
|
screen->toggleActiveShader();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
} // namespace GlobalInputs
|