light/modules/renderer/private/dx/shared_context.hpp

63 lines
1.4 KiB
C++
Raw Permalink Normal View History

2025-07-05 13:28:41 +03:30
#pragma once
#include <d3d11.h>
#include <renderer/shared_context.hpp>
2025-07-05 13:28:41 +03:30
#include <wrl.h>
2025-07-11 00:05:48 +03:30
namespace lt {
2025-07-05 13:28:41 +03:30
class dxSharedContext: public SharedContext
{
public:
2025-07-06 14:02:50 +03:30
[[nodiscard]] auto get_device() -> Microsoft::WRL::ComPtr<ID3D11Device>
2025-07-05 13:28:41 +03:30
{
return m_device;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
2025-07-06 14:02:50 +03:30
[[nodiscard]] auto get_device_context() -> Microsoft::WRL::ComPtr<ID3D11DeviceContext>
2025-07-05 13:28:41 +03:30
{
return m_deviceContext;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
2025-07-06 14:02:50 +03:30
[[nodiscard]] auto get_swap_chain() -> Microsoft::WRL::ComPtr<IDXGISwapChain>
2025-07-05 13:28:41 +03:30
{
return m_swap_chain;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
2025-07-06 14:02:50 +03:30
[[nodiscard]] auto get_render_target_view() -> Microsoft::WRL::ComPtr<ID3D11RenderTargetView>
2025-07-05 13:28:41 +03:30
{
return m_render_target_view;
2025-07-05 13:28:41 +03:30
}
[[nodiscard]] auto GetDeviceRef() -> Microsoft::WRL::ComPtr<ID3D11Device>
2025-07-05 13:28:41 +03:30
{
return m_device;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
[[nodiscard]] auto GetDeviceContextRef() -> Microsoft::WRL::ComPtr<ID3D11DeviceContext>
2025-07-05 13:28:41 +03:30
{
return m_deviceContext;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
[[nodiscard]] auto GetSwapChainRef() -> Microsoft::WRL::ComPtr<IDXGISwapChain>
2025-07-05 13:28:41 +03:30
{
return m_swap_chain;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
[[nodiscard]] auto GetRenderTargetViewRef() -> Microsoft::WRL::ComPtr<ID3D11RenderTargetView>
2025-07-05 13:28:41 +03:30
{
return m_render_target_view;
2025-07-05 13:28:41 +03:30
}
2025-07-05 16:07:51 +03:30
private:
Microsoft::WRL::ComPtr<ID3D11Device> m_device = nullptr;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> m_deviceContext = nullptr;
Microsoft::WRL::ComPtr<IDXGISwapChain> m_swap_chain = nullptr;
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_render_target_view = nullptr;
2025-07-05 13:28:41 +03:30
};
2025-07-11 00:05:48 +03:30
} // namespace lt