diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/d3d/D3D9Context.h |
Diffstat (limited to 'Runtime/GfxDevice/d3d/D3D9Context.h')
-rw-r--r-- | Runtime/GfxDevice/d3d/D3D9Context.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/d3d/D3D9Context.h b/Runtime/GfxDevice/d3d/D3D9Context.h new file mode 100644 index 0000000..370a1c7 --- /dev/null +++ b/Runtime/GfxDevice/d3d/D3D9Context.h @@ -0,0 +1,44 @@ +#pragma once + +#include "D3D9Includes.h" +#include "D3D9Enumeration.h" + +bool InitializeD3D(D3DDEVTYPE devtype); +void CleanupD3D(); +bool InitializeOrResetD3DDevice( + class GfxDevice* device, + HWND window, int width, int height, + int refreshRate, bool fullscreen, int vBlankCount, int fsaa, + int& outBackbufferBPP, int& outFrontbufferBPP, int& outDepthBPP, int& outFSAA ); +void GetBackBuffersAfterDeviceReset(); +bool ResetD3DDevice(); +#if UNITY_EDITOR +void EditorInitializeD3D(GfxDevice* device); +#endif +bool FullResetD3DDevice(); +bool HandleD3DDeviceLost(); +void DestroyD3DDevice(); +extern D3DDEVTYPE g_D3DDevType; +extern DWORD g_D3DAdapter; +extern bool g_D3DUsesMixedVP; +extern bool g_D3DHasDepthStencil; +extern D3DFORMAT g_D3DDepthStencilFormat; + +IDirect3DDevice9* GetD3DDevice(); +IDirect3DDevice9* GetD3DDeviceNoAssert(); +IDirect3D9* GetD3DObject(); +D3D9FormatCaps* GetD3DFormatCaps(); +D3DFORMAT GetD3DFormatForChecks(); + +typedef int (WINAPI* D3DPERF_BeginEventFunc)(D3DCOLOR, LPCWSTR); +typedef int (WINAPI* D3DPERF_EndEventFunc)(); +extern D3DPERF_BeginEventFunc g_D3D9BeginEventFunc; +extern D3DPERF_EndEventFunc g_D3D9EndEventFunc; + + +#if UNITY_EDITOR +bool CreateHiddenWindowD3D(); +void DestroyHiddenWindowD3D(); +extern HWND s_HiddenWindowD3D; +#endif + |