Skip to content

Commit

Permalink
Added 'windowed fullscreen' mode for better screen recording
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Feb 9, 2022
1 parent f8dbd6b commit bb8e08f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/App.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
11 changes: 8 additions & 3 deletions src/UI/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit bb8e08f

Please sign in to comment.