summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-03-31 23:20:15 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-03-31 23:20:15 +0000
commitc6a08259e93f63fbbac8517f8ecf7dc5536e29e3 (patch)
tree5d03fbdcb27100366cd70ae5525bb20479b81c34 /Graphics/GraphicsEngineD3DBase
parentFixed build error on iOS (diff)
downloadDiligentCore-c6a08259e93f63fbbac8517f8ecf7dc5536e29e3.tar.gz
DiligentCore-c6a08259e93f63fbbac8517f8ecf7dc5536e29e3.zip
Some minor updates to d3d swap chain
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h13
1 files changed, 11 insertions, 2 deletions
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<IDXGISwapChain1> 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;