From c6a08259e93f63fbbac8517f8ecf7dc5536e29e3 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 31 Mar 2018 16:20:15 -0700 Subject: Some minor updates to d3d swap chain --- Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngineD3DBase') diff --git a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h index 0dc8bb0d..e61a3842 100644 --- a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h +++ b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h @@ -102,9 +102,18 @@ namespace Diligent swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc.BufferCount = m_SwapChainDesc.BufferCount; swapChainDesc.Scaling = DXGI_SCALING_NONE; + + // DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL is the flip presentation model, where the contents of the back + // buffer is preserved after the call to Present. This flag cannot be used with multisampling. + // The only swap effect that supports multisampling is DXGI_SWAP_EFFECT_DISCARD. // Windows Store apps must use DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_DISCARD. swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; - swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_UNSPECIFIED; // Not used + + swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_UNSPECIFIED; // Transparency behavior is not specified + + // DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH enables an application to switch modes by calling + // IDXGISwapChain::ResizeTarget(). When switching from windowed to fullscreen mode, the display + // mode (or monitor resolution) will be changed to match the dimensions of the application window. swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; CComPtr pSwapChain1; @@ -154,7 +163,7 @@ namespace Diligent if (m_pSwapChain) { // If we are already in fullscreen mode, we need to switch to windowed mode first, - // otherwise swap chain creation will fail + // because a swap chain must be in windowed mode when it is released. if (m_FSDesc.Fullscreen) m_pSwapChain->SetFullscreenState(FALSE, nullptr); m_FSDesc.Fullscreen = True; -- cgit v1.2.3