Skip to content

Commit

Permalink
add fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Qendolin committed Jun 15, 2024
1 parent 0d1aca3 commit 300cf11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 10 additions & 0 deletions src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_() {
Expand Down

0 comments on commit 300cf11

Please sign in to comment.