Diligent Engine API Reference
SwapChainD3D11Impl.h
1 /* Copyright 2015-2018 Egor Yusov
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
12  *
13  * In no event and under no legal theory, whether in tort (including negligence),
14  * contract, or otherwise, unless required by applicable law (such as deliberate
15  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
16  * liable for any damages, including any direct, indirect, special, incidental,
17  * or consequential damages of any character arising as a result of this License or
18  * out of the use or inability to use the software (including but not limited to damages
19  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
20  * all other commercial damages or losses), even if such Contributor has been advised
21  * of the possibility of such damages.
22  */
23 
24 #pragma once
25 
28 
29 #include "SwapChainD3D11.h"
30 #include "SwapChainBase.h"
31 
32 namespace Diligent
33 {
34 
35 class IMemoryAllocator;
37 class SwapChainD3D11Impl : public SwapChainBase<ISwapChainD3D11>
38 {
39 public:
41  SwapChainD3D11Impl(IReferenceCounters *pRefCounters,
43  class RenderDeviceD3D11Impl* pRenderDeviceD3D11,
44  class DeviceContextD3D11Impl* pDeviceContextD3D11,
45  void* pNativeWndHandle);
47 
48  virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final;
49 
50  virtual void Present()override final;
51  virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final;
52 
53  virtual IDXGISwapChain *GetDXGISwapChain()override final{ return m_pSwapChain; }
54 
55  virtual ID3D11RenderTargetView* GetRTV()override final{ return m_pRenderTargetView; }
56  virtual ID3D11DepthStencilView* GetDSV()override final{ return m_pDepthStencilView; }
57 
58 private:
59  void CreateRTVandDSV();
61  CComPtr<IDXGISwapChain> m_pSwapChain;
63  CComPtr<ID3D11RenderTargetView> m_pRenderTargetView;
65  CComPtr<ID3D11DepthStencilView> m_pDepthStencilView;
66 };
67 
68 }
Swap chain description.
Definition: GraphicsTypes.h:912
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
Implementation of the Diligent::ISwapChainD3D11 interface.
Definition: SwapChainD3D11Impl.h:37
virtual ID3D11DepthStencilView * GetDSV() override final
Returns d3d11 depth stencil view of the internal depth buffer object.
Definition: SwapChainD3D11Impl.h:56
virtual void Present() override final
Presents a rendered image to the user.
Definition: SwapChainD3D11Impl.cpp:173
Base implementation of the swap chain.
Definition: SwapChainBase.h:43
Implementation of the Diligent::IRenderDeviceD3D11 interface.
Definition: RenderDeviceD3D11Impl.h:38
virtual void Resize(Uint32 NewWidth, Uint32 NewHeight) override final
Changes the swap chain&#39;s back buffer size.
Definition: SwapChainD3D11Impl.cpp:207
virtual IDXGISwapChain * GetDXGISwapChain() override final
Returns a pointer to the IDXGISwapChain interface of the internal DXGI object.
Definition: SwapChainD3D11Impl.h:53
Implementation of the Diligent::IDeviceContextD3D11 interface.
Definition: DeviceContextD3D11Impl.h:41
virtual ID3D11RenderTargetView * GetRTV() override final
Returns d3d11 render target view of the swap chain&#39;s back buffer.
Definition: SwapChainD3D11Impl.h:55