diff options
| author | Jules Blok <jules.blok@gmail.com> | 2016-11-14 01:45:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-14 01:45:07 +0100 |
| commit | 99de9fbe334a34c438660228e816b851f105dfd3 (patch) | |
| tree | 07f1a24dcaa55269313b0d27a90e982a4566e988 /Source/Core/VideoBackends/D3D/Render.cpp | |
| parent | bc98ec77beef88dd910d7f86c11967aad53061f3 (diff) | |
| parent | 7e35a47b511176aa2c285568d582c6ea281a4ce1 (diff) | |
Merge pull request #4443 from Armada651/exclusive-ui
D3D: Move exclusive mode switching to UI thread.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/Render.cpp | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index bf0b487276..7845c84662 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -851,8 +851,6 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, SetWindowSize(fbStride, fbHeight); const bool windowResized = CheckForResize(); - const bool fullscreen = g_ActiveConfig.bFullscreen && !g_ActiveConfig.bBorderlessFullscreen && - !SConfig::GetInstance().bRenderToMain; bool xfbchanged = s_last_xfb_mode != g_ActiveConfig.bUseRealXFB; @@ -869,33 +867,9 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, // Flip/present backbuffer to frontbuffer here D3D::Present(); - // Check exclusive fullscreen state - bool exclusive_mode, fullscreen_changed = false; - if (SUCCEEDED(D3D::GetFullscreenState(&exclusive_mode))) - { - if (fullscreen && !exclusive_mode) - { - if (g_Config.bExclusiveMode) - OSD::AddMessage("Lost exclusive fullscreen."); - - // Exclusive fullscreen is enabled in the configuration, but we're - // not in exclusive mode. Either exclusive fullscreen was turned on - // or the render frame lost focus. When the render frame is in focus - // we can apply exclusive mode. - fullscreen_changed = Host_RendererHasFocus(); - - g_Config.bExclusiveMode = false; - } - else if (!fullscreen && exclusive_mode) - { - // Exclusive fullscreen is disabled, but we're still in exclusive mode. - fullscreen_changed = true; - } - } - // Resize the back buffers NOW to avoid flickering if (CalculateTargetSize(s_backbuffer_width, s_backbuffer_height) || xfbchanged || windowResized || - fullscreen_changed || s_last_efb_scale != g_ActiveConfig.iEFBScale || + s_last_efb_scale != g_ActiveConfig.iEFBScale || s_last_multisamples != g_ActiveConfig.iMultisamples || s_last_stereo_mode != (g_ActiveConfig.iStereoMode > 0)) { @@ -903,23 +877,8 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, s_last_multisamples = g_ActiveConfig.iMultisamples; PixelShaderCache::InvalidateMSAAShaders(); - if (windowResized || fullscreen_changed) + if (windowResized) { - // Apply fullscreen state - if (fullscreen_changed) - { - g_Config.bExclusiveMode = fullscreen; - - if (fullscreen) - OSD::AddMessage("Entered exclusive fullscreen."); - - D3D::SetFullscreenState(fullscreen); - - // If fullscreen is disabled we can safely notify the UI to exit fullscreen. - if (!g_ActiveConfig.bFullscreen) - Host_RequestFullscreen(false); - } - // TODO: Aren't we still holding a reference to the back buffer right now? D3D::Reset(); SAFE_RELEASE(s_screenshot_texture); @@ -1291,4 +1250,14 @@ void Renderer::BlitScreen(TargetRectangle src, TargetRectangle dst, D3DTexture2D } } +void Renderer::SetFullscreen(bool enable_fullscreen) +{ + D3D::SetFullscreenState(enable_fullscreen); +} + +bool Renderer::IsFullscreen() const +{ + return D3D::GetFullscreenState(); +} + } // namespace DX11 |
