BRE12
DirectXManager.h
1 #pragma once
2 
3 #include <cstdint>
4 #include <d3d12.h>
5 #include <dxgi1_4.h>
6 #include <wrl.h>
7 
8 #include <Utils\DebugUtils.h>
9 
10 namespace BRE {
11 // To initialize and get Direct3D data
13 public:
14  DirectXManager() = delete;
15  ~DirectXManager() = delete;
16  DirectXManager(const DirectXManager&) = delete;
17  const DirectXManager& operator=(const DirectXManager&) = delete;
18  DirectXManager(DirectXManager&&) = delete;
19  DirectXManager& operator=(DirectXManager&&) = delete;
20 
21  static void Init(const HINSTANCE moduleInstanceHandle) noexcept;
22 
23  __forceinline static HWND GetWindowHandle() noexcept
24  {
25  return mWindowHandle;
26  }
27  __forceinline static IDXGIFactory4& GetIDXGIFactory() noexcept
28  {
29  BRE_ASSERT(mDxgiFactory.Get() != nullptr);
30  return *mDxgiFactory.Get();
31  }
32  __forceinline static ID3D12Device& GetDevice() noexcept
33  {
34  BRE_ASSERT(mDevice.Get() != nullptr);
35  return *mDevice.Get();
36  }
37  __forceinline static std::size_t GetDescriptorHandleIncrementSize(const D3D12_DESCRIPTOR_HEAP_TYPE descriptorHeapType)
38  {
39  BRE_ASSERT(mDevice.Get() != nullptr);
40  return mDevice.Get()->GetDescriptorHandleIncrementSize(descriptorHeapType);
41  }
42 
43 private:
44  static HWND mWindowHandle;
45  static Microsoft::WRL::ComPtr<IDXGIFactory4> mDxgiFactory;
46  static Microsoft::WRL::ComPtr<ID3D12Device> mDevice;
47 };
48 
49 }
50 
Definition: DirectXManager.h:12
Definition: Camera.cpp:8