NoGUI: Start in fullscreen when option or command line flag is set

This commit is contained in:
Connor McLaughlin
2021-02-01 01:02:54 +10:00
parent 23e102b90a
commit 590513350c
10 changed files with 20 additions and 10 deletions

View File

@ -48,7 +48,8 @@ bool NoGUIHostInterface::Initialize()
CreateImGuiContext();
if (!CreatePlatformWindow())
const bool start_fullscreen = m_command_line_flags.start_fullscreen || g_settings.start_fullscreen;
if (!CreatePlatformWindow(start_fullscreen))
{
Log_ErrorPrintf("Failed to create platform window");
ImGui::DestroyContext();
@ -264,12 +265,14 @@ bool NoGUIHostInterface::AcquireHostDisplay()
if (needs_switch)
{
const bool was_fullscreen = IsFullscreen();
ImGui::EndFrame();
DestroyDisplay();
// We need to recreate the window, otherwise bad things happen...
DestroyPlatformWindow();
if (!CreatePlatformWindow())
if (!CreatePlatformWindow(was_fullscreen))
Panic("Failed to recreate platform window on GPU renderer switch");
if (!CreateDisplay())