From bb8e08fc7c0c65859dd453ac6019d1c80887462a Mon Sep 17 00:00:00 2001 From: Adam Kewley Date: Wed, 9 Feb 2022 11:19:20 +0100 Subject: [PATCH] Added 'windowed fullscreen' mode for better screen recording --- src/App.cpp | 5 +++++ src/App.hpp | 3 +++ src/UI/MainMenu.cpp | 11 ++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 0138f613e..ebe14c5a1 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -900,6 +900,11 @@ void osc::App::makeFullscreen() SDL_SetWindowFullscreen(m_Impl->window, SDL_WINDOW_FULLSCREEN); } +void osc::App::makeWindowedFullscreen() +{ + SDL_SetWindowFullscreen(m_Impl->window, SDL_WINDOW_FULLSCREEN_DESKTOP); +} + void osc::App::makeWindowed() { SDL_SetWindowFullscreen(m_Impl->window, 0); diff --git a/src/App.hpp b/src/App.hpp index dfe53d518..6118b6e3f 100644 --- a/src/App.hpp +++ b/src/App.hpp @@ -121,6 +121,9 @@ namespace osc // makes the main window fullscreen void makeFullscreen(); + // makes the main window fullscreen, but still composited with the desktop (so-called 'windowed maximized' in games) + void makeWindowedFullscreen(); + // makes the main window windowed (as opposed to fullscreen) void makeWindowed(); diff --git a/src/UI/MainMenu.cpp b/src/UI/MainMenu.cpp index aa4a8209d..19edd6c30 100644 --- a/src/UI/MainMenu.cpp +++ b/src/UI/MainMenu.cpp @@ -317,11 +317,16 @@ void osc::MainMenuAboutTab::draw() { ImGui::TextUnformatted("window"); ImGui::NextColumn(); - if (ImGui::Button(ICON_FA_EXPAND " fullscreen")) { + if (ImGui::Button(ICON_FA_EXPAND " fullscreen")) + { App::cur().makeFullscreen(); } - ImGui::SameLine(); - if (ImGui::Button(ICON_FA_WINDOW_RESTORE " windowed")) { + if (ImGui::Button(ICON_FA_EXPAND " windowed fullscreen")) + { + App::cur().makeWindowedFullscreen(); + } + if (ImGui::Button(ICON_FA_WINDOW_RESTORE " windowed")) + { App::cur().makeWindowed(); } ImGui::NextColumn();