Diligent Engine  v.2.4.g
SwapChainD3DBase.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * In no event and under no legal theory, whether in tort (including negligence),
18  * contract, or otherwise, unless required by applicable law (such as deliberate
19  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
20  * liable for any damages, including any direct, indirect, special, incidental,
21  * or consequential damages of any character arising as a result of this License or
22  * out of the use or inability to use the software (including but not limited to damages
23  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
24  * all other commercial damages or losses), even if such Contributor has been advised
25  * of the possibility of such damages.
26  */
27 
28 #pragma once
29 
30 #include <VersionHelpers.h>
31 #include "SwapChainBase.hpp"
32 
35 
36 namespace Diligent
37 {
38 
40 template <class BaseInterface, typename DXGISwapChainType>
41 class SwapChainD3DBase : public SwapChainBase<BaseInterface>
42 {
43 public:
46  IRenderDevice* pDevice,
47  IDeviceContext* pDeviceContext,
48  const SwapChainDesc& SCDesc,
49  const FullScreenModeDesc& FSDesc,
50  const NativeWindow& Window) :
51  // clang-format off
52  TBase{pRefCounters, pDevice, pDeviceContext, SCDesc},
53  m_FSDesc {FSDesc},
54  m_Window {Window},
55  m_MaxFrameLatency {SCDesc.BufferCount}
56  // clang-format on
57  {
60  {
62  " is not an allowed pretransform because Direct3D swap chains only support identity transform. "
63  "Use SURFACE_TRANSFORM_OPTIMAL (recommended) or SURFACE_TRANSFORM_IDENTITY.");
64  }
67  }
68 
70  {
71  if (m_pSwapChain)
72  {
73  // Swap chain must be in windowed mode when it is destroyed
74  // https://msdn.microsoft.com/en-us/library/windows/desktop/bb205075(v=vs.85).aspx#Destroying
75  BOOL IsFullScreen = FALSE;
76  m_pSwapChain->GetFullscreenState(&IsFullScreen, nullptr);
77  if (IsFullScreen)
78  m_pSwapChain->SetFullscreenState(FALSE, nullptr);
79  }
80  }
81 
82 protected:
83  virtual void UpdateSwapChain(bool CreateNew) = 0;
84 
85  bool Resize(Uint32 NewWidth, Uint32 NewHeight, SURFACE_TRANSFORM NewPreTransform, Int32 Dummy = 0 /*To be different from virtual function*/)
86  {
87  if (NewPreTransform != SURFACE_TRANSFORM_OPTIMAL &&
88  NewPreTransform != SURFACE_TRANSFORM_IDENTITY)
89  {
91  " is not an allowed pretransform because Direct3D swap chains only support identity transform. "
92  "Use SURFACE_TRANSFORM_OPTIMAL (recommended) or SURFACE_TRANSFORM_IDENTITY.");
93  }
94  NewPreTransform = SURFACE_TRANSFORM_OPTIMAL;
95 
96  return TBase::Resize(NewWidth, NewHeight, NewPreTransform);
97  }
98 
99  void CreateDXGISwapChain(IUnknown* pD3D11DeviceOrD3D12CmdQueue)
100  {
101 #if PLATFORM_WIN32
102  auto hWnd = reinterpret_cast<HWND>(m_Window.hWnd);
103  if (m_SwapChainDesc.Width == 0 || m_SwapChainDesc.Height == 0)
104  {
105  RECT rc;
106  if (m_FSDesc.Fullscreen)
107  {
108  const HWND hDesktop = GetDesktopWindow();
109  GetWindowRect(hDesktop, &rc);
110  }
111  else
112  {
113  GetClientRect(hWnd, &rc);
114  }
115  m_SwapChainDesc.Width = rc.right - rc.left;
116  m_SwapChainDesc.Height = rc.bottom - rc.top;
117  }
118 #endif
119 
121  "Direct3D swap chains only support identity transform.");
124 
126 
127  DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {};
128 
129  swapChainDesc.Width = m_SwapChainDesc.Width;
130  swapChainDesc.Height = m_SwapChainDesc.Height;
131  // Flip model swapchains (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL and DXGI_SWAP_EFFECT_FLIP_DISCARD) only support the following Formats:
132  // - DXGI_FORMAT_R16G16B16A16_FLOAT
133  // - DXGI_FORMAT_B8G8R8A8_UNORM
134  // - DXGI_FORMAT_R8G8B8A8_UNORM
135  // - DXGI_FORMAT_R10G10B10A2_UNORM
136  // If RGBA8_UNORM_SRGB swap chain is required, we will create RGBA8_UNORM swap chain, but
137  // create RGBA8_UNORM_SRGB render target view
138  switch (DXGIColorBuffFmt)
139  {
140  case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
141  swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
142  break;
143 
144  case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
145  swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
146  break;
147 
148  default:
149  swapChainDesc.Format = DXGIColorBuffFmt;
150  }
151 
152  swapChainDesc.Stereo = FALSE;
153 
154  // Multi-sampled swap chains are not supported anymore. CreateSwapChainForHwnd() fails when sample count is not 1
155  // for any swap effect.
156  swapChainDesc.SampleDesc.Count = 1;
157  swapChainDesc.SampleDesc.Quality = 0;
158 
159  DEV_CHECK_ERR(m_SwapChainDesc.Usage != 0, "No swap chain usage flags defined");
160  static_assert(SWAP_CHAIN_USAGE_LAST == SWAP_CHAIN_USAGE_COPY_SOURCE, "Please update this function to handle the new swapchain usage");
161  swapChainDesc.BufferUsage = 0;
163  swapChainDesc.BufferUsage |= DXGI_USAGE_RENDER_TARGET_OUTPUT;
165  swapChainDesc.BufferUsage |= DXGI_USAGE_SHADER_INPUT;
166  //if (m_SwapChainDesc.Usage & SWAP_CHAIN_USAGE_COPY_SOURCE)
167  // ;
168 
169  swapChainDesc.BufferCount = m_SwapChainDesc.BufferCount;
170  swapChainDesc.Scaling = DXGI_SCALING_NONE;
171 
172 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
173  // DXGI_SCALING_NONE is supported starting with Windows 8
174  if (!IsWindows8OrGreater())
175  swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
176 #endif
177 
178  // DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL is the flip presentation model, where the contents of the back
179  // buffer is preserved after the call to Present. This flag cannot be used with multisampling.
180  // The only swap effect that supports multisampling is DXGI_SWAP_EFFECT_DISCARD.
181  // Windows Store apps must use DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_DISCARD.
182  swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
183 
184  swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_UNSPECIFIED; // Transparency behavior is not specified
185 
186  // DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH enables an application to switch modes by calling
187  // IDXGISwapChain::ResizeTarget(). When switching from windowed to fullscreen mode, the display
188  // mode (or monitor resolution) will be changed to match the dimensions of the application window.
189  swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
190 
191 
192  CComPtr<IDXGIFactory2> pDXGIFactory;
193 
194  HRESULT hr = CreateDXGIFactory1(__uuidof(pDXGIFactory), reinterpret_cast<void**>(static_cast<IDXGIFactory2**>(&pDXGIFactory)));
195  CHECK_D3D_RESULT_THROW(hr, "Failed to create DXGI factory");
196 
197  // DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT enables querying a waitable object that can be
198  // used to synchronize presentation with CPU timeline.
199  // The flag is not supported in D3D11 fullscreen mode.
200  if (!(m_FSDesc.Fullscreen && m_pRenderDevice->GetDeviceCaps().DevType == RENDER_DEVICE_TYPE_D3D11))
201  {
202  // We do not need pDXGIFactory3 itself, however DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT flag
203  // is only supported starting with Windows 8.1, and so is IDXGIFactory3 interface. We query this
204  // interface to check Windows 8.1.
205  // Note that we can't use IsWindows8Point1OrGreater because unlike IsWindows8OrGreater, it returns
206  // false if an application is not manifested for Windows 8.1 or Windows 10, even if the current
207  // operating system version is Windows 8.1 or Windows 10.
208  CComPtr<IDXGIFactory3> pDXGIFactory3;
209  if (SUCCEEDED(pDXGIFactory.QueryInterface(&pDXGIFactory3)))
210  {
211  swapChainDesc.Flags |= DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT;
212  }
213  }
214 
215 
216  CComPtr<IDXGISwapChain1> pSwapChain1;
217 
218 #if PLATFORM_WIN32
219 
220  DXGI_SWAP_CHAIN_FULLSCREEN_DESC FullScreenDesc = {};
221 
222  FullScreenDesc.Windowed = m_FSDesc.Fullscreen ? FALSE : TRUE;
223  FullScreenDesc.RefreshRate.Numerator = m_FSDesc.RefreshRateNumerator;
224  FullScreenDesc.RefreshRate.Denominator = m_FSDesc.RefreshRateDenominator;
225  FullScreenDesc.Scaling = static_cast<DXGI_MODE_SCALING>(m_FSDesc.Scaling);
226  FullScreenDesc.ScanlineOrdering = static_cast<DXGI_MODE_SCANLINE_ORDER>(m_FSDesc.ScanlineOrder);
227 
228  hr = pDXGIFactory->CreateSwapChainForHwnd(pD3D11DeviceOrD3D12CmdQueue, hWnd, &swapChainDesc, &FullScreenDesc, nullptr, &pSwapChain1);
229  CHECK_D3D_RESULT_THROW(hr, "Failed to create Swap Chain");
230 
231  {
232  // This is silly, but IDXGIFactory used for MakeWindowAssociation must be retrieved via
233  // calling IDXGISwapchain::GetParent first, otherwise it won't work
234  // https://www.gamedev.net/forums/topic/634235-dxgidisabling-altenter/?do=findComment&comment=4999990
235  CComPtr<IDXGIFactory1> pFactoryFromSC;
236  if (SUCCEEDED(pSwapChain1->GetParent(__uuidof(pFactoryFromSC), (void**)&pFactoryFromSC)))
237  {
238  // Do not allow the swap chain to handle Alt+Enter
239  pFactoryFromSC->MakeWindowAssociation(hWnd, DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER);
240  }
241  }
242 
243 #elif PLATFORM_UNIVERSAL_WINDOWS
244 
245  if (m_FSDesc.Fullscreen)
246  LOG_WARNING_MESSAGE("UWP applications do not support fullscreen mode");
247 
248  hr = pDXGIFactory->CreateSwapChainForCoreWindow(
249  pD3D11DeviceOrD3D12CmdQueue,
250  reinterpret_cast<IUnknown*>(m_Window.pCoreWindow),
251  &swapChainDesc,
252  nullptr,
253  &pSwapChain1);
254  CHECK_D3D_RESULT_THROW(hr, "Failed to create DXGI swap chain");
255 
256 #endif
257 
258  hr = pSwapChain1.QueryInterface(&m_pSwapChain);
259  CHECK_D3D_RESULT_THROW(hr, "Failed to query the required swap chain interface");
260 
261  if ((swapChainDesc.Flags & DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT) != 0)
262  {
263  CComPtr<IDXGISwapChain2> pSwapChain2;
264  if (SUCCEEDED(pSwapChain1.QueryInterface(&pSwapChain2)))
265  {
266  // IMPORTANT: SetMaximumFrameLatency must be called BEFORE GetFrameLatencyWaitableObject!
267  pSwapChain2->SetMaximumFrameLatency(m_MaxFrameLatency);
268 
269  m_FrameLatencyWaitableObject = pSwapChain2->GetFrameLatencyWaitableObject();
270  VERIFY(m_FrameLatencyWaitableObject != NULL, "Waitable object must not be null");
271  }
272  }
273  else
274  {
277  }
278  }
279 
281  {
282  // https://docs.microsoft.com/en-us/windows/uwp/gaming/reduce-latency-with-dxgi-1-3-swap-chains#step-4-wait-before-rendering-each-frame
283  if (m_FrameLatencyWaitableObject != NULL)
284  {
285  auto Res = WaitForSingleObjectEx(m_FrameLatencyWaitableObject,
286  500, // 0.5 second timeout (shouldn't ever occur)
287  true);
288  if (Res != WAIT_OBJECT_0)
289  {
290  const char* ErrorMsg = Res == WAIT_TIMEOUT ?
291  "Timeout elapsed while waiting for the frame waitable object." :
292  "Waiting for the frame waitable object failed.";
293  LOG_ERROR_MESSAGE(ErrorMsg, " This is a strong indication of a synchronization error.");
294  }
295  }
296  }
297 
298  virtual void DILIGENT_CALL_TYPE SetFullscreenMode(const DisplayModeAttribs& DisplayMode) override final
299  {
300  if (m_pSwapChain)
301  {
302  // If we are already in fullscreen mode, we need to switch to windowed mode first,
303  // because a swap chain must be in windowed mode when it is released.
304  // https://msdn.microsoft.com/en-us/library/windows/desktop/bb205075(v=vs.85).aspx#Destroying
305  if (m_FSDesc.Fullscreen)
306  m_pSwapChain->SetFullscreenState(FALSE, nullptr);
307  m_FSDesc.Fullscreen = True;
308  m_FSDesc.RefreshRateNumerator = DisplayMode.RefreshRateNumerator;
309  m_FSDesc.RefreshRateDenominator = DisplayMode.RefreshRateDenominator;
310  m_FSDesc.Scaling = DisplayMode.Scaling;
311  m_FSDesc.ScanlineOrder = DisplayMode.ScanlineOrder;
312  m_SwapChainDesc.Width = DisplayMode.Width;
313  m_SwapChainDesc.Height = DisplayMode.Height;
314  if (DisplayMode.Format != TEX_FORMAT_UNKNOWN)
315  m_SwapChainDesc.ColorBufferFormat = DisplayMode.Format;
316  UpdateSwapChain(true);
317  }
318  }
319 
320  virtual void DILIGENT_CALL_TYPE SetWindowedMode() override final
321  {
322  if (m_FSDesc.Fullscreen)
323  {
324  m_FSDesc.Fullscreen = False;
325  m_pSwapChain->SetFullscreenState(FALSE, nullptr);
326  }
327  }
328 
329  virtual void DILIGENT_CALL_TYPE SetMaximumFrameLatency(Uint32 MaxLatency) override final
330  {
331  if (m_MaxFrameLatency == MaxLatency)
332  return;
333 
334  m_MaxFrameLatency = MaxLatency;
335 
336  if (m_FrameLatencyWaitableObject != NULL)
337  {
338  // A swap chain must be in windowed mode when it is released.
339  // https://msdn.microsoft.com/en-us/library/windows/desktop/bb205075(v=vs.85).aspx#Destroying
340  if (m_FSDesc.Fullscreen)
341  {
342  // SetFullscreenState(FALSE) calls Resize that initializes Width and Height
343  // with the window size. We need to save current values and restore them.
344  Uint32 Width = m_SwapChainDesc.Width;
345  Uint32 Height = m_SwapChainDesc.Height;
346  m_pSwapChain->SetFullscreenState(FALSE, nullptr);
347  m_SwapChainDesc.Width = Width;
348  m_SwapChainDesc.Height = Height;
349  }
350 
351  // Destroying the swap chain and creating a new one is the only reliable way to
352  // change the maximum frame latency of a waitable swap chain.
353  UpdateSwapChain(true);
354  }
355  else
356  {
358  }
359  }
360 
362 
364  CComPtr<DXGISwapChainType> m_pSwapChain;
365  NativeWindow m_Window;
366 
368 
370 };
371 
372 } // namespace Diligent
Diligent::SWAP_CHAIN_USAGE_RENDER_TARGET
@ SWAP_CHAIN_USAGE_RENDER_TARGET
Swap chain can be used as render target ouput.
Definition: GraphicsTypes.h:1301
Diligent::GetSurfaceTransformString
const char * GetSurfaceTransformString(SURFACE_TRANSFORM SrfTransform)
Definition: GraphicsAccessories.cpp:1119
Diligent::IReferenceCounters
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
LOG_ERROR_MESSAGE
#define LOG_ERROR_MESSAGE(...)
Definition: Errors.hpp:122
Diligent::SwapChainBase::m_DesiredPreTransform
SURFACE_TRANSFORM m_DesiredPreTransform
Desired surface pre-transformation.
Definition: SwapChainBase.hpp:125
Diligent::SwapChainD3DBase::CreateDXGISwapChain
void CreateDXGISwapChain(IUnknown *pD3D11DeviceOrD3D12CmdQueue)
Definition: SwapChainD3DBase.hpp:99
Diligent::SwapChainD3DBase::Resize
bool Resize(Uint32 NewWidth, Uint32 NewHeight, SURFACE_TRANSFORM NewPreTransform, Int32 Dummy=0)
Definition: SwapChainD3DBase.hpp:85
Diligent::SwapChainDesc::Width
Uint32 Width
The swap chain width. Default value is 0.
Definition: GraphicsTypes.h:1350
SwapChainBase.hpp
Diligent::SwapChainDesc::ColorBufferFormat
TEXTURE_FORMAT ColorBufferFormat
Back buffer format. Default value is Diligent::TEX_FORMAT_RGBA8_UNORM_SRGB.
Definition: GraphicsTypes.h:1356
Diligent::FullScreenModeDesc::RefreshRateDenominator
Uint32 RefreshRateDenominator
Refresh rate denominator.
Definition: GraphicsTypes.h:1434
Diligent::SwapChainD3DBase::m_pSwapChain
CComPtr< DXGISwapChainType > m_pSwapChain
Definition: SwapChainD3DBase.hpp:364
Diligent::SwapChainD3DBase::UpdateSwapChain
virtual void UpdateSwapChain(bool CreateNew)=0
Diligent::SURFACE_TRANSFORM_IDENTITY
@ SURFACE_TRANSFORM_IDENTITY
The image content is presented without being transformed.
Definition: GraphicsTypes.h:1321
Diligent::SwapChainD3DBase::m_MaxFrameLatency
Uint32 m_MaxFrameLatency
Definition: SwapChainD3DBase.hpp:369
DEV_CHECK_ERR
#define DEV_CHECK_ERR(...)
Definition: DebugUtilities.hpp:90
Diligent::TEX_FORMAT_UNKNOWN
@ TEX_FORMAT_UNKNOWN
Unknown format.
Definition: GraphicsTypes.h:331
Diligent::FullScreenModeDesc::Scaling
enum SCALING_MODE Scaling
The scanline drawing mode.
Definition: GraphicsTypes.h:1437
Diligent::Int32
int32_t Int32
32-bit signed integer
Definition: BasicTypes.h:46
Diligent::SURFACE_TRANSFORM_OPTIMAL
@ SURFACE_TRANSFORM_OPTIMAL
Uset the most optimal surface transform.
Definition: GraphicsTypes.h:1318
Diligent::IRenderDevice
Render device interface.
Definition: RenderDevice.h:75
Diligent::SURFACE_TRANSFORM
SURFACE_TRANSFORM
The transform applied to the image content prior to presentation.
Definition: GraphicsTypes.h:1315
Diligent::SwapChainD3DBase::SetDXGIDeviceMaximumFrameLatency
virtual void SetDXGIDeviceMaximumFrameLatency()
Definition: SwapChainD3DBase.hpp:361
Diligent::SwapChainD3DBase
Base implementation of a D3D swap chain.
Definition: SwapChainD3DBase.hpp:41
Diligent::SwapChainDesc::Usage
SWAP_CHAIN_USAGE_FLAGS Usage
Swap chain usage flags. Default value is Diligent::SWAP_CHAIN_USAGE_RENDER_TARGET.
Definition: GraphicsTypes.h:1363
Dummy
n int Dummy
Definition: GenerateMipsCS_inc.h:25
Diligent::DisplayModeAttribs
Display mode attributes.
Definition: GraphicsTypes.h:1269
DILIGENT_CALL_TYPE
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
Diligent::SwapChainDesc::BufferCount
Uint32 BufferCount
The number of buffers in the swap chain.
Definition: GraphicsTypes.h:1379
Diligent::SwapChainD3DBase::WaitForFrame
void WaitForFrame()
Definition: SwapChainD3DBase.hpp:280
Diligent::SwapChainD3DBase::m_Window
NativeWindow m_Window
Definition: SwapChainD3DBase.hpp:365
Diligent::SwapChainBase
Base implementation of the swap chain.
Definition: SwapChainBase.hpp:51
Diligent::SWAP_CHAIN_USAGE_COPY_SOURCE
@ SWAP_CHAIN_USAGE_COPY_SOURCE
Swap chain images can be used as source of copy operation.
Definition: GraphicsTypes.h:1307
Diligent::SwapChainDesc
Swap chain description.
Definition: GraphicsTypes.h:1347
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::SwapChainBase::Resize
bool Resize(Uint32 NewWidth, Uint32 NewHeight, SURFACE_TRANSFORM NewPreTransform, Int32 Dummy=0)
Definition: SwapChainBase.hpp:97
Diligent::SwapChainD3DBase::m_FSDesc
FullScreenModeDesc m_FSDesc
Definition: SwapChainD3DBase.hpp:363
Diligent::SwapChainD3DBase::SetFullscreenMode
virtual void SetFullscreenMode(const DisplayModeAttribs &DisplayMode) override final
Definition: SwapChainD3DBase.hpp:298
Diligent::SWAP_CHAIN_USAGE_LAST
@ SWAP_CHAIN_USAGE_LAST
Definition: GraphicsTypes.h:1309
Diligent::SwapChainBase::m_pRenderDevice
RefCntAutoPtr< IRenderDevice > m_pRenderDevice
Strong reference to the render device.
Definition: SwapChainBase.hpp:115
Diligent::SWAP_CHAIN_USAGE_SHADER_INPUT
@ SWAP_CHAIN_USAGE_SHADER_INPUT
Swap chain images can be used as shader inputs.
Definition: GraphicsTypes.h:1304
Diligent::FullScreenModeDesc::Fullscreen
Bool Fullscreen
A Boolean value that specifies whether the swap chain is in fullscreen mode.
Definition: GraphicsTypes.h:1428
Diligent::SwapChainBase::m_SwapChainDesc
SwapChainDesc m_SwapChainDesc
Swap chain description.
Definition: SwapChainBase.hpp:122
LOG_WARNING_MESSAGE
#define LOG_WARNING_MESSAGE(...)
Definition: Errors.hpp:123
Diligent::SwapChainD3DBase::SwapChainD3DBase
SwapChainD3DBase(IReferenceCounters *pRefCounters, IRenderDevice *pDevice, IDeviceContext *pDeviceContext, const SwapChainDesc &SCDesc, const FullScreenModeDesc &FSDesc, const NativeWindow &Window)
Definition: SwapChainD3DBase.hpp:45
Diligent::SwapChainD3DBase::m_FrameLatencyWaitableObject
HANDLE m_FrameLatencyWaitableObject
Definition: SwapChainD3DBase.hpp:367
Diligent::IDeviceContext
Device context interface.
Definition: DeviceContext.h:1460
Diligent::RENDER_DEVICE_TYPE_D3D11
@ RENDER_DEVICE_TYPE_D3D11
D3D11 device.
Definition: GraphicsTypes.h:1482
Diligent::SwapChainDesc::PreTransform
SURFACE_TRANSFORM PreTransform
The transform, relative to the presentation engine's natural orientation, applied to the image conten...
Definition: GraphicsTypes.h:1376
Diligent::TexFormatToDXGI_Format
DXGI_FORMAT TexFormatToDXGI_Format(TEXTURE_FORMAT TexFormat, Uint32 BindFlags=0)
Definition: DXGITypeConversions.cpp:276
Diligent::FullScreenModeDesc::RefreshRateNumerator
Uint32 RefreshRateNumerator
Refresh rate numerator.
Definition: GraphicsTypes.h:1431
Diligent::SwapChainD3DBase::~SwapChainD3DBase
~SwapChainD3DBase()
Definition: SwapChainD3DBase.hpp:69
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
CHECK_D3D_RESULT_THROW
#define CHECK_D3D_RESULT_THROW(Expr, Message)
Definition: D3DErrors.hpp:82
Diligent::FullScreenModeDesc::ScanlineOrder
enum SCANLINE_ORDER ScanlineOrder
The scaling mode.
Definition: GraphicsTypes.h:1440
Diligent::SwapChainD3DBase::SetMaximumFrameLatency
virtual void SetMaximumFrameLatency(Uint32 MaxLatency) override final
Definition: SwapChainD3DBase.hpp:329
Diligent::SwapChainDesc::Height
Uint32 Height
The swap chain height. Default value is 0.
Definition: GraphicsTypes.h:1353
Diligent::SwapChainD3DBase::SetWindowedMode
virtual void SetWindowedMode() override final
Definition: SwapChainD3DBase.hpp:320
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::FullScreenModeDesc
Full screen mode description.
Definition: GraphicsTypes.h:1425