VideoConfig: Add "Borderless Fullscreen" option.

This option will disable exclusive fullscreen for users who prefer the old behaviour.
This commit is contained in:
Jules Blok 2014-07-19 20:18:03 +02:00
parent 3400871992
commit cd94ff1966
7 changed files with 21 additions and 1 deletions

View File

@ -114,6 +114,7 @@ static wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D grap
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 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 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 _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked."); static wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked.");
static wxString borderless_fullscreen_desc = wxTRANSLATE("Don't use exclusive mode when in fullscreen.\nAllows for faster transitions between fullscreen and windowed mode.\nIncreases input latency, makes movement less smooth and slightly decreases performance.\nExclusive mode is required to support 3D Vision.\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 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_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."); 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.");
@ -584,6 +585,11 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
szr_misc->Add(cb_prog_scan); szr_misc->Add(cb_prog_scan);
} }
// Borderless Fullscreen
borderless_fullscreen = CreateCheckBox(page_advanced, _("Borderless Fullscreen"), wxGetTranslation(borderless_fullscreen_desc), vconfig.bForceBorderlessFullscreen);
borderless_fullscreen->Show(vconfig.backend_info.bSupportsExclusiveFullscreen);
szr_misc->Add(borderless_fullscreen);
wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc")); wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc"));
szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5); szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5);
group_misc->Add(szr_misc, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5); group_misc->Add(szr_misc, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);

View File

@ -159,6 +159,10 @@ protected:
_3d_vision->Enable(vconfig.backend_info.bSupports3DVision); _3d_vision->Enable(vconfig.backend_info.bSupports3DVision);
_3d_vision->Show(vconfig.backend_info.bSupports3DVision); _3d_vision->Show(vconfig.backend_info.bSupports3DVision);
// Borderless Fullscreen
borderless_fullscreen->Enable(vconfig.backend_info.bSupportsExclusiveFullscreen);
borderless_fullscreen->Show(vconfig.backend_info.bSupportsExclusiveFullscreen);
// EFB copy // EFB copy
efbcopy_texture->Enable(vconfig.bEFBCopyEnable); efbcopy_texture->Enable(vconfig.bEFBCopyEnable);
efbcopy_ram->Enable(vconfig.bEFBCopyEnable); efbcopy_ram->Enable(vconfig.bEFBCopyEnable);
@ -189,6 +193,7 @@ protected:
SettingChoice* choice_aamode; SettingChoice* choice_aamode;
SettingCheckBox* _3d_vision; SettingCheckBox* _3d_vision;
SettingCheckBox* borderless_fullscreen;
SettingRadioButton* efbcopy_texture; SettingRadioButton* efbcopy_texture;
SettingRadioButton* efbcopy_ram; SettingRadioButton* efbcopy_ram;

View File

@ -938,7 +938,8 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl
SetWindowSize(fbWidth, fbHeight); SetWindowSize(fbWidth, fbHeight);
const bool windowResized = CheckForResize(); const bool windowResized = CheckForResize();
const bool fullscreen = g_ActiveConfig.bFullscreen && !SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain; const bool fullscreen = g_ActiveConfig.bFullscreen && !g_ActiveConfig.bForceBorderlessFullscreen &&
!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain;
bool fullscreen_changed = s_last_fullscreen_mode != fullscreen; bool fullscreen_changed = s_last_fullscreen_mode != fullscreen;

View File

@ -85,6 +85,7 @@ void InitBackendInfo()
g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats
g_Config.backend_info.bUseMinimalMipCount = true; g_Config.backend_info.bUseMinimalMipCount = true;
g_Config.backend_info.bSupports3DVision = false; g_Config.backend_info.bSupports3DVision = false;
g_Config.backend_info.bSupportsExclusiveFullscreen = true;
g_Config.backend_info.bSupportsDualSourceBlend = true; g_Config.backend_info.bSupportsDualSourceBlend = true;
g_Config.backend_info.bSupportsPrimitiveRestart = true; g_Config.backend_info.bSupportsPrimitiveRestart = true;
g_Config.backend_info.bSupportsOversizedViewports = false; g_Config.backend_info.bSupportsOversizedViewports = false;

View File

@ -144,6 +144,7 @@ static void InitBackendInfo()
g_Config.backend_info.bUseRGBATextures = true; g_Config.backend_info.bUseRGBATextures = true;
g_Config.backend_info.bUseMinimalMipCount = false; g_Config.backend_info.bUseMinimalMipCount = false;
g_Config.backend_info.bSupports3DVision = false; g_Config.backend_info.bSupports3DVision = false;
g_Config.backend_info.bSupportsExclusiveFullscreen = false;
//g_Config.backend_info.bSupportsDualSourceBlend = true; // is gpu dependent and must be set in renderer //g_Config.backend_info.bSupportsDualSourceBlend = true; // is gpu dependent and must be set in renderer
//g_Config.backend_info.bSupportsEarlyZ = true; // is gpu dependent and must be set in renderer //g_Config.backend_info.bSupportsEarlyZ = true; // is gpu dependent and must be set in renderer
g_Config.backend_info.bSupportsOversizedViewports = true; g_Config.backend_info.bSupportsOversizedViewports = true;

View File

@ -39,6 +39,7 @@ VideoConfig::VideoConfig()
backend_info.bUseRGBATextures = false; backend_info.bUseRGBATextures = false;
backend_info.bUseMinimalMipCount = false; backend_info.bUseMinimalMipCount = false;
backend_info.bSupports3DVision = false; backend_info.bSupports3DVision = false;
backend_info.bSupportsExclusiveFullscreen = false;
} }
void VideoConfig::Load(const std::string& ini_file) void VideoConfig::Load(const std::string& ini_file)
@ -83,6 +84,7 @@ void VideoConfig::Load(const std::string& ini_file)
settings->Get("DisableFog", &bDisableFog, 0); settings->Get("DisableFog", &bDisableFog, 0);
settings->Get("OMPDecoder", &bOMPDecoder, false); settings->Get("OMPDecoder", &bOMPDecoder, false);
settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false); settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false);
settings->Get("ForceBorderlessFullscreen", &bForceBorderlessFullscreen, false);
IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements"); IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
enhancements->Get("ForceFiltering", &bForceFiltering, 0); enhancements->Get("ForceFiltering", &bForceFiltering, 0);
@ -211,6 +213,7 @@ void VideoConfig::VerifyValidity()
if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0; if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0;
if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0; if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0;
if (!backend_info.bSupports3DVision) b3DVision = false; if (!backend_info.bSupports3DVision) b3DVision = false;
if (!backend_info.bSupportsExclusiveFullscreen) bForceBorderlessFullscreen = false;
} }
void VideoConfig::Save(const std::string& ini_file) void VideoConfig::Save(const std::string& ini_file)
@ -255,6 +258,7 @@ void VideoConfig::Save(const std::string& ini_file)
settings->Set("DisableFog", bDisableFog); settings->Set("DisableFog", bDisableFog);
settings->Set("OMPDecoder", bOMPDecoder); settings->Set("OMPDecoder", bOMPDecoder);
settings->Set("EnableShaderDebugging", bEnableShaderDebugging); settings->Set("EnableShaderDebugging", bEnableShaderDebugging);
settings->Set("ForceBorderlessFullscreen", bForceBorderlessFullscreen);
IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements"); IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
enhancements->Set("ForceFiltering", bForceFiltering); enhancements->Set("ForceFiltering", bForceFiltering);

View File

@ -101,6 +101,7 @@ struct VideoConfig final
int iAnaglyphStereoSeparation; int iAnaglyphStereoSeparation;
int iAnaglyphFocalAngle; int iAnaglyphFocalAngle;
bool b3DVision; bool b3DVision;
bool bForceBorderlessFullscreen;
// Hacks // Hacks
bool bEFBAccessEnable; bool bEFBAccessEnable;
@ -140,6 +141,7 @@ struct VideoConfig final
bool bUseRGBATextures; // used for D3D in TextureCache bool bUseRGBATextures; // used for D3D in TextureCache
bool bUseMinimalMipCount; bool bUseMinimalMipCount;
bool bSupports3DVision; bool bSupports3DVision;
bool bSupportsExclusiveFullscreen;
bool bSupportsDualSourceBlend; bool bSupportsDualSourceBlend;
bool bSupportsPrimitiveRestart; bool bSupportsPrimitiveRestart;
bool bSupportsOversizedViewports; bool bSupportsOversizedViewports;