From 7344f752b7d6e78e2c48069a0476076a7e2f0b22 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Tue, 7 Oct 2014 16:43:32 +0200 Subject: [PATCH 1/3] Replace BorderlessFullscreenEnabled by ExclusiveFullscreenEnabled. Special handling was associated with this function, which only applies to exclusive fullscreen. --- Source/Core/DolphinWX/Frame.cpp | 6 +++--- Source/Core/DolphinWX/FrameTools.cpp | 2 +- Source/Core/VideoCommon/VideoConfig.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index bd98c974ca..c33ebf5e3c 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -1251,7 +1251,7 @@ void CFrame::OnMouse(wxMouseEvent& event) void CFrame::DoFullscreen(bool enable_fullscreen) { - if (!g_Config.BorderlessFullscreenEnabled() && + if (g_Config.ExclusiveFullscreenEnabled() && !SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && Core::GetState() == Core::CORE_PAUSE) { @@ -1278,7 +1278,7 @@ void CFrame::DoFullscreen(bool enable_fullscreen) { m_RenderFrame->ShowFullScreen(true, wxFULLSCREEN_ALL); } - else if (g_Config.BorderlessFullscreenEnabled() || + else if (!g_Config.ExclusiveFullscreenEnabled() || SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) { // Exiting exclusive fullscreen should be done from a Renderer callback. @@ -1335,7 +1335,7 @@ void CFrame::DoFullscreen(bool enable_fullscreen) m_RenderFrame->Raise(); } - g_Config.bFullscreen = (g_Config.BorderlessFullscreenEnabled() || + g_Config.bFullscreen = (!g_Config.ExclusiveFullscreenEnabled() || SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) ? false : enable_fullscreen; } diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 4da987f7c8..4fc7af3136 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1104,7 +1104,7 @@ void CFrame::DoStop() // If exclusive fullscreen is not enabled then we can pause the emulation // before we've exited fullscreen. If not then we need to exit fullscreen first. - if (!RendererIsFullscreen() || g_Config.BorderlessFullscreenEnabled() || + if (!RendererIsFullscreen() || !g_Config.ExclusiveFullscreenEnabled() || SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) { Core::SetState(Core::CORE_PAUSE); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index ed37a84995..715eaff89c 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -151,7 +151,7 @@ struct VideoConfig final bool VirtualXFBEnabled() const { return bUseXFB && !bUseRealXFB; } bool EFBCopiesToTextureEnabled() const { return bEFBCopyEnable && bCopyEFBToTexture; } bool EFBCopiesToRamEnabled() const { return bEFBCopyEnable && !bCopyEFBToTexture; } - bool BorderlessFullscreenEnabled() const { return !backend_info.bSupportsExclusiveFullscreen || bBorderlessFullscreen; } + bool ExclusiveFullscreenEnabled() const { return backend_info.bSupportsExclusiveFullscreen && !bBorderlessFullscreen; } }; extern VideoConfig g_Config; From 39f421d45ddf9ba77ad8e6a3ee676bcd31157a52 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Tue, 7 Oct 2014 16:46:10 +0200 Subject: [PATCH 2/3] Support the borderless fullscreen option in all backends. --- Source/Core/DolphinWX/Frame.cpp | 2 +- Source/Core/DolphinWX/VideoConfigDiag.cpp | 3 +-- Source/Core/DolphinWX/VideoConfigDiag.h | 4 ---- Source/Core/VideoCommon/VideoConfig.cpp | 1 - 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index c33ebf5e3c..b101357d02 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -187,7 +187,7 @@ WXLRESULT CRenderFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPa bool CRenderFrame::ShowFullScreen(bool show, long style) { - if (show) + if (show && !g_Config.bBorderlessFullscreen) { // OpenGL requires the pop-up style to activate exclusive mode. SetWindowStyle((GetWindowStyle() & ~wxDEFAULT_FRAME_STYLE) | wxPOPUP_WINDOW); diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index b9cf58baef..a12771ae0b 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -119,7 +119,7 @@ static wxString scaled_efb_copy_desc = wxTRANSLATE("Greatly increases quality of static wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D graphics per-pixel rather than per vertex.\nDecreases emulation speed by some percent (depending on your GPU).\nThis usually is a safe enhancement, but might cause issues sometimes.\n\nIf unsure, leave this unchecked."); static wxString fast_depth_calc_desc = wxTRANSLATE("Use a less accurate algorithm to calculate depth values.\nCauses issues in a few games but might give a decent speedup.\n\nIf unsure, leave this checked."); static wxString force_filtering_desc = wxTRANSLATE("Force texture filtering even if the emulated game explicitly disabled it.\nImproves texture quality slightly but causes glitches in some games.\n\nIf unsure, leave this unchecked."); -static wxString borderless_fullscreen_desc = wxTRANSLATE("Implement fullscreen mode with a borderless window spanning the whole screen instead of using exclusive mode.\nAllows for faster transitions between fullscreen and windowed mode, but increases input latency, makes movement less smooth and slightly decreases performance.\nExclusive mode is required to support Nvidia 3D Vision.\n\nIf unsure, leave this unchecked."); +static wxString borderless_fullscreen_desc = wxTRANSLATE("Implement fullscreen mode with a borderless window spanning the whole screen instead of using exclusive mode.\nAllows for faster transitions between fullscreen and windowed mode, but increases input latency, makes movement less smooth and slightly decreases performance.\nExclusive mode is required to support Nvidia 3D Vision in the Direct3D backend.\n\nIf unsure, leave this unchecked."); static wxString internal_res_desc = wxTRANSLATE("Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.\n\"Multiple of 640x528\" is a bit slower than \"Window Size\" but yields less issues. Generally speaking, the lower the internal resolution is, the better your performance will be.\n\nIf unsure, select 640x528."); static wxString efb_access_desc = wxTRANSLATE("Ignore any requests of the CPU to read from or write to the EFB.\nImproves performance in some games, but might disable some gameplay-related features or graphical effects.\n\nIf unsure, leave this unchecked."); static wxString efb_emulate_format_changes_desc = wxTRANSLATE("Ignore any changes to the EFB format.\nImproves performance in many games without any negative effect. Causes graphical defects in a small number of other games though.\n\nIf unsure, leave this checked."); @@ -590,7 +590,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con // Borderless Fullscreen borderless_fullscreen = CreateCheckBox(page_advanced, _("Borderless Fullscreen"), wxGetTranslation(borderless_fullscreen_desc), vconfig.bBorderlessFullscreen); - borderless_fullscreen->Show(vconfig.backend_info.bSupportsExclusiveFullscreen); szr_misc->Add(borderless_fullscreen); wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc")); diff --git a/Source/Core/DolphinWX/VideoConfigDiag.h b/Source/Core/DolphinWX/VideoConfigDiag.h index b20679c5f5..bd242d3a99 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.h +++ b/Source/Core/DolphinWX/VideoConfigDiag.h @@ -175,10 +175,6 @@ protected: choice_aamode->Enable(vconfig.backend_info.AAModes.size() > 1); text_aamode->Enable(vconfig.backend_info.AAModes.size() > 1); - // Borderless Fullscreen - borderless_fullscreen->Enable(vconfig.backend_info.bSupportsExclusiveFullscreen); - borderless_fullscreen->Show(vconfig.backend_info.bSupportsExclusiveFullscreen); - // EFB copy efbcopy_texture->Enable(vconfig.bEFBCopyEnable); efbcopy_ram->Enable(vconfig.bEFBCopyEnable); diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index ec7b0f9862..1c9c94b283 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -208,7 +208,6 @@ void VideoConfig::VerifyValidity() // TODO: Check iMaxAnisotropy value if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0; if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0; - if (!backend_info.bSupportsExclusiveFullscreen) bBorderlessFullscreen = false; } void VideoConfig::Save(const std::string& ini_file) From 03e1bd0995c5e77d954067653716fd72b7579c95 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Thu, 9 Oct 2014 11:30:26 +0200 Subject: [PATCH 3/3] Limit Borderless Fullscreen to Windows systems. --- Source/Core/DolphinWX/Frame.cpp | 4 ++++ Source/Core/DolphinWX/VideoConfigDiag.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index b101357d02..dc44ef5d70 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -187,19 +187,23 @@ WXLRESULT CRenderFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPa bool CRenderFrame::ShowFullScreen(bool show, long style) { +#if defined WIN32 if (show && !g_Config.bBorderlessFullscreen) { // OpenGL requires the pop-up style to activate exclusive mode. SetWindowStyle((GetWindowStyle() & ~wxDEFAULT_FRAME_STYLE) | wxPOPUP_WINDOW); } +#endif bool result = wxTopLevelWindow::ShowFullScreen(show, style); +#if defined WIN32 if (!show) { // Restore the default style. SetWindowStyle((GetWindowStyle() & ~wxPOPUP_WINDOW) | wxDEFAULT_FRAME_STYLE); } +#endif return result; } diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index a12771ae0b..1c349f3a7b 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -588,9 +588,11 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con szr_misc->Add(progressive_scan_checkbox); } +#if defined WIN32 // Borderless Fullscreen borderless_fullscreen = CreateCheckBox(page_advanced, _("Borderless Fullscreen"), wxGetTranslation(borderless_fullscreen_desc), vconfig.bBorderlessFullscreen); szr_misc->Add(borderless_fullscreen); +#endif wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc")); szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5);