2#include "Graphics/Common.h"
31 bool Init(HWND outputWindow);
47 [[nodiscard]]
inline ID3D11Device1*
GetDevice() const noexcept {
return m_device.Get(); }
53 [[nodiscard]]
inline ID3D11DeviceContext1*
GetImmediateContext() const noexcept {
return m_immediateContext.Get(); }
59 [[nodiscard]]
inline IDXGISwapChain1*
GetSwapChain() const noexcept {
return m_swapChain.Get(); }
65 [[nodiscard]]
inline ID3D11RenderTargetView*
GetBackBuffer() const noexcept {
return m_bbRTView.Get(); }
120 void Resize(U32 width, U32 height)
noexcept { m_backBufferWidth = width; m_backBufferHeight = height; }
122 inline void SetVSYNC(
bool enableVSYNC) { m_vsync = enableVSYNC; }
128 void CheckForSuitableOutput();
136 ComPtr<IDXGIFactory2> m_factory;
137 ComPtr<IDXGIAdapter1> m_adapter;
138 ComPtr<IDXGIOutput> m_output;
140 ComPtr<ID3D11Device1> m_device;
141 ComPtr<ID3D11DeviceContext1> m_immediateContext;
142 ComPtr<IDXGISwapChain1> m_swapChain;
143 ComPtr<ID3D11Texture2D> m_bbTexture;
144 ComPtr<ID3D11RenderTargetView> m_bbRTView;
146 DXGI_FORMAT m_backBufferFormat;
147 U32 m_backBufferWidth;
148 U32 m_backBufferHeight;
149 U32 m_multiSampleCount;
150 U32 m_multiSampleQuality;
152 DXGI_RATIONAL m_refreshRate;
153 U32 m_numVSYNCIntervals;
156 D3D_FEATURE_LEVEL m_featureLevel;
157 D3D_FEATURE_LEVEL m_minFeatureLevel;
Class managing DirectX 11 device resources including device, context, swap chain, and render target.
Definition D3DManager.h:10
bool IsVSyncEnabled() const noexcept
Checks if vertical synchronization is enabled.
Definition D3DManager.h:107
bool Init(HWND outputWindow)
Initializes the device resources.
Definition D3DManager.cpp:46
void Resize(U32 width, U32 height) noexcept
Resizes the back buffer.
Definition D3DManager.h:120
U32 GetBackBufferWidth() const noexcept
Retrieves the width of the back buffer.
Definition D3DManager.h:83
IDXGISwapChain1 * GetSwapChain() const noexcept
Retrieves the swap chain associated with the device.
Definition D3DManager.h:59
void Reset()
Resets the device resources.
Definition D3DManager.cpp:161
void Present() const
Presents the rendered image to the screen.
Definition D3DManager.cpp:180
bool IsInitialized() const noexcept
Checks if the device resources have been initialized.
Definition D3DManager.cpp:38
U32 GetBackBufferHeight() const noexcept
Retrieves the height of the back buffer.
Definition D3DManager.h:89
D3DManager()
Default constructor.
Definition D3DManager.cpp:5
ID3D11RenderTargetView * GetBackBuffer() const noexcept
Retrieves the render target view for the back buffer.
Definition D3DManager.h:65
DXGI_FORMAT GetBackBufferFormat() const noexcept
Retrieves the format of the back buffer.
Definition D3DManager.h:77
ID3D11Device1 * GetDevice() const noexcept
Retrieves the Direct3D device.
Definition D3DManager.h:47
U32 GetBBMultiSampleQuality() const noexcept
Retrieves the multi-sample quality of the back buffer.
Definition D3DManager.h:101
ID3D11DeviceContext1 * GetImmediateContext() const noexcept
Retrieves the immediate context for the device.
Definition D3DManager.h:53
U32 GetNumVSyncInterval() const noexcept
Retrieves the number of vertical synchronization intervals.
Definition D3DManager.h:113
U32 GetBBMultiSampleCount() const noexcept
Retrieves the multi-sample count of the back buffer.
Definition D3DManager.h:95
~D3DManager()
Destructor.
Definition D3DManager.cpp:20
ID3D11Texture2D * GetBackBufferTexture() const noexcept
Retrieves the back buffer texture.
Definition D3DManager.h:71