Add borderless window mode (from tasks) (#630)

This commit is contained in:
ChancellorIkseew
2025-09-30 23:53:15 +03:00
committed by GitHub
parent 06e65911a3
commit b30b19e836
6 changed files with 53 additions and 25 deletions
+10 -5
View File
@@ -135,10 +135,11 @@ void Engine::initializeClient() {
if (ENGINE_DEBUG_BUILD) {
menus::create_version_label(*gui);
}
keepAlive(settings.display.fullscreen.observe(
[this](bool value) {
if (value != this->window->isFullscreen()) {
this->window->toggleFullscreen();
keepAlive(settings.display.windowMode.observe(
[this](int value) {
WindowMode mode = static_cast<WindowMode>(value);
if (mode != this->window->getMode()) {
this->window->setMode(mode);
}
},
true
@@ -237,7 +238,11 @@ void Engine::updateHotkeys() {
gui->toggleDebug();
}
if (input->jpressed(Keycode::F11)) {
settings.display.fullscreen.toggle();
if (settings.display.windowMode.get() != static_cast<int>(WindowMode::FULLSCREEN)) {
settings.display.windowMode.set(static_cast<int>(WindowMode::FULLSCREEN));
} else {
settings.display.windowMode.set(static_cast<int>(WindowMode::WINDOWED));
}
}
}