17 #include <ht_platform.h> 18 #include <ht_directx.h> 19 #include <ht_d3d12rootlayout.h> 28 static const int NUM_BUFFER_FRAMES = 2;
36 void ExecuteCommandList();
37 void MoveToNextFrame();
38 void ValidateDevice();
39 bool Initialize(HWND hwnd, uint32_t width, uint32_t height);
40 void Resize(uint32_t width, uint32_t height);
43 ID3D12Device* GetDevice();
45 IDXGISwapChain3* GetSwapChain();
46 ID3D12Resource* GetRenderTarget();
47 ID3D12Resource* GetDepthStencil();
48 ID3D12CommandAllocator* GetCommandAllocator();
49 ID3D12CommandQueue* GetCommandQueue();
50 ID3D12GraphicsCommandList* GetCommandList();
51 D3D12_VIEWPORT GetScreenViewport();
52 uint32_t GetCurrentFrameIndex();
54 CD3DX12_CPU_DESCRIPTOR_HANDLE GetRenderTargetView();
55 CD3DX12_CPU_DESCRIPTOR_HANDLE GetDepthStencilView();
59 uint32_t m_currentFrame;
62 uint64_t m_fenceValues[NUM_BUFFER_FRAMES];
63 uint64_t m_currentFence;
65 D3D12_VIEWPORT m_viewport;
66 D3D12_RECT m_scissorRect;
67 ID3D12Device* m_device;
68 D3D12RootLayoutHandle m_rootLayout;
69 IDXGISwapChain3* m_swapChain;
70 DXGI_SWAP_CHAIN_DESC m_swapChainDesc;
71 ID3D12CommandQueue* m_commandQueue;
72 ID3D12CommandAllocator* m_commandAllocators[NUM_BUFFER_FRAMES];
73 ID3D12GraphicsCommandList* m_commandList;
74 ID3D12Resource* m_renderTargets[NUM_BUFFER_FRAMES];
75 ID3D12Resource* m_depthStencil;
76 ID3D12DescriptorHeap* m_renderTargetViewHeap;
77 uint32_t m_renderTargetViewHeapSize;
78 ID3D12DescriptorHeap* m_depthStencilHeap;
81 bool CreateDeviceResources(HWND hwnd, uint32_t width, uint32_t height);
82 HRESULT CheckHardwareAdapter(IDXGIFactory2 * pFactory, IDXGIAdapter1 ** ppAdapter);
83 void DestroyDeviceResources();
84 bool CreateBuffers(uint32_t width, uint32_t height);
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_color.h:19
Definition: ht_d3d12rootlayout.h:30
Definition: ht_d3d12deviceresources.h:26