From 64cb3d0f85aa6c0c830a9b6667d810d2ca7c5a5f Mon Sep 17 00:00:00 2001 From: Daid Date: Fri, 28 Oct 2022 21:14:45 +0200 Subject: [PATCH] Add keybinding for full screen toggle for https://github.com/daid/EmptyEpsilon/issues/1750 --- src/windowManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/windowManager.cpp b/src/windowManager.cpp index e4f878f6..2196c3ff 100644 --- a/src/windowManager.cpp +++ b/src/windowManager.cpp @@ -12,12 +12,15 @@ #include "Renderable.h" #include "collisionable.h" #include "postProcessManager.h" +#include "io/keybinding.h" #include #include #include #include +sp::io::Keybinding fullscreen_key{"FULLSCREEN"}; + static string getFromEnvironment(const char* key, string default_value) { auto value = getenv(key); if (!value) @@ -61,6 +64,9 @@ Window::~Window() void Window::render() { + if (fullscreen_key.getDown()) + setMode(getMode() == Mode::Window ? Mode::Fullscreen : Mode::Window); + SDL_GL_MakeCurrent(static_cast(window), gl_context); int w, h;