#pragma once #if PLATFORM_WIN32 #include #elif PLATFORM_UNIVERSAL_WINDOWS #include #endif #include #include #include class UnityGraphicsD3D11Impl { public: void CreateDeviceAndContext(); void CreateSwapChain(void* pNativeWndHandle, unsigned int Width, unsigned int Height); void CreateRTVandDSV(); void Present(); void ResizeSwapChain(UINT NewWidth, UINT NewHeight); ID3D11Device* GetD3D11Device() { return m_d3d11Device; } IDXGISwapChain* GetDXGISwapChain() { return m_SwapChain; } ID3D11DeviceContext* GetD3D11Context() { return m_d3d11Context; } ID3D11RenderTargetView* GetRTV() { return m_BackBufferRTV; } ID3D11DepthStencilView* GetDSV() { return m_DepthBufferDSV; } UINT GetBackBufferWidth()const { return m_BackBufferWidth; } UINT GetBackBufferHeight()const { return m_BackBufferHeight; } IDXGISwapChain* GetSwapChain(){ return m_SwapChain; } private: UINT m_BackBufferWidth = 0, m_BackBufferHeight = 0; CComPtr m_d3d11Device; CComPtr m_d3d11Context; CComPtr m_SwapChain; CComPtr m_BackBufferRTV; CComPtr m_DepthBufferDSV; };