feat: add fullscreen support

This commit is contained in:
2026-03-28 16:52:55 +08:00
parent a7c42f249d
commit f41e9f7757
3 changed files with 51 additions and 5 deletions

View File

@@ -40,6 +40,9 @@ void App::init() {
}
void App::key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
App* app = static_cast<App*>(glfwGetWindowUserPointer(window));
CUBED_ASSERT_MSG(app, "nullptr");
switch(key) {
case GLFW_KEY_Q:
if (action == GLFW_PRESS) {
@@ -55,10 +58,14 @@ void App::key_callback(GLFWwindow* window, int key, int scancode, int action, in
if (action == GLFW_PRESS) {
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
case GLFW_KEY_F11:
if (action == GLFW_PRESS) {
app->m_window.toggle_fullscreen();
}
break;
}
App* app = static_cast<App*>(glfwGetWindowUserPointer(window));
CUBED_ASSERT_MSG(app, "nullptr");
app->m_world.get_player("TestPlayer").update_player_move_state(key, action);
}