From 300cf11b83f7dfd6e45f57c30b804ac79ed02a5a Mon Sep 17 00:00:00 2001 From: Qendolin <32160662+Qendolin@users.noreply.github.com> Date: Sat, 15 Jun 2024 23:01:50 +0200 Subject: [PATCH] add fullscreen --- README.md | 1 + src/Game.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 51946ed..22a8993 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Use mouse to look. | `F2` | Hide GUI | | `F3` | Toggle debug menu | | `F5` | Reload assets / shaders | +| `F11` | Toggle Fullscreen | The FreeCamâ„¢ mode uses WASD movement and the scrolling to change speed. diff --git a/src/Game.cpp b/src/Game.cpp index d762ae9..b39458c 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -250,6 +250,16 @@ void Game::processInput_() { if (input->isKeyPress(GLFW_KEY_F2)) { ui->setHidden(!ui->hidden()); } + + if (input->isKeyPress(GLFW_KEY_F11)) { + if (glfwGetWindowAttrib(window, GLFW_DECORATED) == GLFW_TRUE) { + glfwSetWindowAttrib(window, GLFW_DECORATED, GLFW_FALSE); + glfwMaximizeWindow(window); + } else { + glfwRestoreWindow(window); + glfwSetWindowAttrib(window, GLFW_DECORATED, GLFW_TRUE); + } + } } void Game::update_() {