@@ -38,21 +38,20 @@ class CHW
3838 BOOL support (D3DFORMAT fmt, DWORD type, DWORD usage);
3939#endif // !USE_OGL
4040
41- #ifdef DEBUG
42- #if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
43- void Validate (void ){};
44- #else // USE_DX10
45- void Validate (void )
41+ #if defined(DEBUG) && defined(USE_DX9)
42+ void Validate ()
4643 {
4744 VERIFY (pDevice);
4845 VERIFY (pD3D);
4946 };
50- #endif // USE_DX10
5147#else
52- void Validate (void ){};
48+ void Validate () {}
5349#endif
5450
55- // Variables section
51+ // Variables section
52+ public:
53+ CHWCaps Caps;
54+
5655#if defined(USE_OGL)
5756 CHW* pDevice;
5857 CHW* pContext;
@@ -63,62 +62,40 @@ class CHW
6362 GLuint pFB;
6463 GLuint pCFB;
6564
66- CHWCaps Caps;
67-
6865 SDL_Window* m_hWnd;
6966 HDC m_hDC;
7067 SDL_GLContext m_hRC;
71- #elif defined(USE_DX11)
72- public:
73- IDXGIFactory1* m_pFactory = nullptr ;
74- IDXGIAdapter1* m_pAdapter = nullptr ; // pD3D equivalent
75- ID3D11Device* pDevice = nullptr ; // combine with DX9 pDevice via typedef
76- ID3D11DeviceContext* pContext = nullptr ; // combine with DX9 pDevice via typedef
77- IDXGISwapChain* m_pSwapChain = nullptr ;
78- ID3D11RenderTargetView* pBaseRT = nullptr ; // combine with DX9 pBaseRT via typedef
79- ID3D11DepthStencilView* pBaseZB = nullptr ;
80-
81- CHWCaps Caps;
68+ #else // General DirectX
69+ ID3DDevice* pDevice = nullptr ; // render device
70+ ID3DRenderTargetView* pBaseRT = nullptr ; // base render target
71+ ID3DDepthStencilView* pBaseZB = nullptr ; // base depth-stencil buffer
8272
8373 D3D_DRIVER_TYPE m_DriverType;
84- DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent
85- D3D_FEATURE_LEVEL FeatureLevel;
86- #elif defined(USE_DX10)
87- public:
74+ #ifndef USE_DX9
8875 IDXGIFactory1* m_pFactory = nullptr ;
89- IDXGIAdapter1* m_pAdapter = nullptr ; // pD3D equivalent
90- ID3D10Device1* pDevice1 = nullptr ; // combine with DX9 pDevice via typedef
91- ID3D10Device* pDevice = nullptr ; // combine with DX9 pDevice via typedef
92- ID3D10Device1* pContext1 = nullptr ; // combine with DX9 pDevice via typedef
93- ID3D10Device* pContext = nullptr ; // combine with DX9 pDevice via typedef
76+ IDXGIAdapter1* m_pAdapter = nullptr ; // pD3D equivalent
77+ ID3DDeviceContext* pContext = nullptr ;
9478 IDXGISwapChain* m_pSwapChain = nullptr ;
95- ID3D10RenderTargetView* pBaseRT = nullptr ; // combine with DX9 pBaseRT via typedef
96- ID3D10DepthStencilView* pBaseZB = nullptr ;
97-
98- CHWCaps Caps;
99-
100- D3D10_DRIVER_TYPE m_DriverType;
101- DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent
79+ DXGI_SWAP_CHAIN_DESC m_ChainDesc; // DevPP equivalent
10280 D3D_FEATURE_LEVEL FeatureLevel;
103- #else
104- private:
81+ #if defined(USE_DX10)
82+ ID3D10Device1* pDevice1 = nullptr ;
83+ ID3D10Device1* pContext1 = nullptr ;
84+ #endif
85+ #else // USE_DX9
10586#ifdef DEBUG
10687 IDirect3DStateBlock9* dwDebugSB = nullptr ;
10788#endif
89+ private:
10890 XRay::Module hD3D = nullptr ;
10991
11092public:
11193 IDirect3D9* pD3D = nullptr ; // D3D
112- IDirect3DDevice9* pDevice = nullptr ; // render device
113- IDirect3DSurface9* pBaseRT = nullptr ;
114- IDirect3DSurface9* pBaseZB = nullptr ;
115-
116- CHWCaps Caps;
11794
11895 UINT DevAdapter;
119- D3DDEVTYPE m_DriverType;
12096 D3DPRESENT_PARAMETERS DevPP;
121- #endif // USE_DX10
97+ #endif // USE_DX9
98+ #endif // USE_OGL
12299
123100#if !defined(_MAYA_EXPORT) && !defined(USE_OGL)
124101 stats_manager stats_manager;
@@ -128,7 +105,7 @@ class CHW
128105 void UpdateViews ();
129106#endif
130107#if defined(USE_DX10) || defined(USE_DX11)
131- bool CheckFormatSupport (DXGI_FORMAT format, D3D_FORMAT_SUPPORT feature) const ;
108+ bool CheckFormatSupport (DXGI_FORMAT format, UINT feature) const ;
132109 DXGI_FORMAT SelectFormat (D3D_FORMAT_SUPPORT feature, const DXGI_FORMAT formats[], size_t count) const ;
133110 virtual void OnAppActivate ();
134111 virtual void OnAppDeactivate ();
0 commit comments