From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/GfxDevice/d3d/D3D9Window.h | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Runtime/GfxDevice/d3d/D3D9Window.h (limited to 'Runtime/GfxDevice/d3d/D3D9Window.h') diff --git a/Runtime/GfxDevice/d3d/D3D9Window.h b/Runtime/GfxDevice/d3d/D3D9Window.h new file mode 100644 index 0000000..038b59f --- /dev/null +++ b/Runtime/GfxDevice/d3d/D3D9Window.h @@ -0,0 +1,39 @@ +#ifndef D3D9WINDOW_H +#define D3D9WINDOW_H + +#include "D3D9Includes.h" +#include "Runtime/GfxDevice/GfxDeviceWindow.h" +#include "Runtime/GfxDevice/GfxDeviceObjects.h" +#include "D3D9Utils.h" +#include "TexturesD3D9.h" + +class D3D9Window : public GfxDeviceWindow +{ +private: + IDirect3DDevice9* m_Device; + IDirect3DSwapChain9* m_SwapChain; + RenderColorSurfaceD3D9 m_BackBuffer; + RenderDepthSurfaceD3D9 m_DepthStencil; + D3DFORMAT m_DepthStencilFormat; + int m_FSAALevel; +public: + D3D9Window( IDirect3DDevice9* device, HWND window, int width, int height, DepthBufferFormat depthFormat, int antiAlias ); + ~D3D9Window(); + + bool Reshape( int width, int height, DepthBufferFormat depthFormat, int antiAlias ); + + bool BeginRendering(); + bool EndRendering( bool presentContent ); + void SetAsActiveWindow (); + + D3DFORMAT GetDepthStencilFormat() const { return m_DepthStencilFormat; } + + RenderSurfaceHandle GetBackBuffer(); + RenderSurfaceHandle GetDepthStencil(); +}; + +#if UNITY_EDITOR +int GetCurrentD3DFSAALevel(); +#endif + +#endif -- cgit v1.1-26-g67d0