light/modules/renderer/public/dx/shared_context.hpp
light7734 cd886aa8c9
Some checks reported errors
continuous-integration/drone/push Build was killed
refactor: flatten directory structure
2025-07-20 04:46:15 +03:30

62 lines
1.4 KiB
C++

#pragma once
#include <d3d11.h>
#include <renderer/shared_context.hpp>
#include <wrl.h>
namespace lt {
class dxSharedContext: public SharedContext
{
public:
[[nodiscard]] auto get_device() -> Microsoft::WRL::ComPtr<ID3D11Device>
{
return m_device;
}
[[nodiscard]] auto get_device_context() -> Microsoft::WRL::ComPtr<ID3D11DeviceContext>
{
return m_deviceContext;
}
[[nodiscard]] auto get_swap_chain() -> Microsoft::WRL::ComPtr<IDXGISwapChain>
{
return m_swap_chain;
}
[[nodiscard]] auto get_render_target_view() -> Microsoft::WRL::ComPtr<ID3D11RenderTargetView>
{
return m_render_target_view;
}
[[nodiscard]] auto GetDeviceRef() -> Microsoft::WRL::ComPtr<ID3D11Device>
{
return m_device;
}
[[nodiscard]] auto GetDeviceContextRef() -> Microsoft::WRL::ComPtr<ID3D11DeviceContext>
{
return m_deviceContext;
}
[[nodiscard]] auto GetSwapChainRef() -> Microsoft::WRL::ComPtr<IDXGISwapChain>
{
return m_swap_chain;
}
[[nodiscard]] auto GetRenderTargetViewRef() -> Microsoft::WRL::ComPtr<ID3D11RenderTargetView>
{
return m_render_target_view;
}
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;
};
} // namespace lt