light/Engine/src/Platform/GraphicsAPI/DirectX/dxSharedContext.h
Light 5cc82f1558 Maintenance
- Added 'Get*Ref()' to 'dxSharedContext'

- Fixed 'dxFramebuffer::Resize' not resizing :/
- Fixed 'dxFrameBuffer::BindAsTarget' not setting the viewport
- Fixed 'dxRenderCommand::SetViewport()' not resizing the swapchain's
      buffer

- Improved 'dxGraphicsContext''s debug interface

-  Removed most of the 'ComPtr's in 'dxGraphicsContext',  they can be
      accessed with the 'm_SharedContext'
2021-07-22 13:00:41 +04:30

32 lines
No EOL
1.4 KiB
C++

#pragma once
#include "Base.h"
#include "Graphics/SharedContext.h"
#include <d3d11.h>
#include <wrl.h>
namespace Light {
// #todo:
class dxSharedContext : public SharedContext
{
private:
Microsoft::WRL::ComPtr<ID3D11Device > m_Device = nullptr;
Microsoft::WRL::ComPtr<ID3D11DeviceContext > m_DeviceContext = nullptr;
Microsoft::WRL::ComPtr<IDXGISwapChain > m_SwapChain = nullptr;
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_RenderTargetView = nullptr;
public:
inline Microsoft::WRL::ComPtr<ID3D11Device > GetDevice () { return m_Device; }
inline Microsoft::WRL::ComPtr<ID3D11DeviceContext > GetDeviceContext () { return m_DeviceContext; }
inline Microsoft::WRL::ComPtr<IDXGISwapChain > GetSwapChain () { return m_SwapChain; }
inline Microsoft::WRL::ComPtr<ID3D11RenderTargetView> GetRenderTargetView() { return m_RenderTargetView; }
inline Microsoft::WRL::ComPtr<ID3D11Device >& GetDeviceRef () { return m_Device; }
inline Microsoft::WRL::ComPtr<ID3D11DeviceContext >& GetDeviceContextRef () { return m_DeviceContext; }
inline Microsoft::WRL::ComPtr<IDXGISwapChain >& GetSwapChainRef () { return m_SwapChain; }
inline Microsoft::WRL::ComPtr<ID3D11RenderTargetView>& GetRenderTargetViewRef() { return m_RenderTargetView; }
};
}