mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Add borderless window mode (from tasks) (#630)
This commit is contained in:
parent
06e65911a3
commit
b30b19e836
6 changed files with 53 additions and 25 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue