From 557b97489d5d5780fae4fb5fa7897950e2d01b1f Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Wed, 24 Jul 2019 20:08:47 -0700 Subject: Fixed issue with DXGI swap chain not supporting DXGI_SCALING_NONE on Windows 7 --- Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineD3DBase') diff --git a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h index c4cfa0b9..1afdd1d6 100644 --- a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h +++ b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h @@ -23,6 +23,7 @@ #pragma once +#include #include "SwapChainBase.h" /// \file @@ -111,7 +112,8 @@ namespace Diligent // ; swapChainDesc.BufferCount = m_SwapChainDesc.BufferCount; - swapChainDesc.Scaling = DXGI_SCALING_NONE; + // DXGI_SCALING_NONE is not supported in Windows 7 + swapChainDesc.Scaling = IsWindows8OrGreater() ? DXGI_SCALING_NONE : DXGI_SCALING_STRETCH; // 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. @@ -135,9 +137,9 @@ namespace Diligent DXGI_SWAP_CHAIN_FULLSCREEN_DESC FullScreenDesc = {}; FullScreenDesc.Windowed = m_FSDesc.Fullscreen ? FALSE : TRUE; - FullScreenDesc.RefreshRate.Numerator = m_FSDesc.RefreshRateNumerator; + FullScreenDesc.RefreshRate.Numerator = m_FSDesc.RefreshRateNumerator; FullScreenDesc.RefreshRate.Denominator = m_FSDesc.RefreshRateDenominator; - FullScreenDesc.Scaling = static_cast(m_FSDesc.Scaling); + FullScreenDesc.Scaling = static_cast(m_FSDesc.Scaling); FullScreenDesc.ScanlineOrdering = static_cast(m_FSDesc.ScanlineOrder); hr = factory->CreateSwapChainForHwnd(pD3D11DeviceOrD3D12CmdQueue, hWnd, &swapChainDesc, &FullScreenDesc, nullptr, &pSwapChain1); CHECK_D3D_RESULT_THROW(hr, "Failed to create Swap Chain"); -- cgit v1.2.3