Skip to content

Commit 161f67a

Browse files
committed
xrRenderGL: Implement glHW to replace glRenderDeviceRender.
1 parent 2ea745c commit 161f67a

File tree

7 files changed

+375
-18
lines changed

7 files changed

+375
-18
lines changed

src/Layers/xrRender/HW.h

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,29 @@ class CHW
2323
CHW();
2424
~CHW();
2525

26+
#ifndef USE_OGL
2627
void CreateD3D ();
2728
void DestroyD3D ();
29+
#endif // !USE_OGL
2830
void CreateDevice (HWND hw, bool move_window);
2931

3032
void DestroyDevice ();
3133

3234
void Reset (HWND hw);
3335

36+
#ifndef USE_OGL
3437
void selectResolution (u32 &dwWidth, u32 &dwHeight, BOOL bWindowed);
3538
D3DFORMAT selectDepthStencil (D3DFORMAT);
3639
u32 selectPresentInterval ();
3740
u32 selectGPU ();
3841
u32 selectRefresh (u32 dwWidth, u32 dwHeight, D3DFORMAT fmt);
39-
void updateWindowProps (HWND hw);
4042
BOOL support (D3DFORMAT fmt, DWORD type, DWORD usage);
43+
#endif // !USE_OGL
44+
45+
void updateWindowProps(HWND hw);
4146

4247
#ifdef DEBUG
43-
#if defined(USE_DX10) || defined(USE_DX11)
48+
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
4449
void Validate(void) {};
4550
#else // USE_DX10
4651
void Validate(void) { VERIFY(pDevice); VERIFY(pD3D); };
@@ -50,7 +55,17 @@ class CHW
5055
#endif
5156

5257
// Variables section
53-
#if defined(USE_DX11) // USE_DX10
58+
#if defined(USE_OGL)
59+
public:
60+
CHW* pDevice;
61+
GLuint pBaseZB;
62+
63+
CHWCaps Caps;
64+
65+
HWND m_hWnd;
66+
HDC m_hDC;
67+
HGLRC m_hRC;
68+
#elif defined(USE_DX11)
5469
public:
5570
IDXGIAdapter* m_pAdapter; // pD3D equivalent
5671
ID3D11Device* pDevice; // combine with DX9 pDevice via typedef
@@ -99,18 +114,20 @@ class CHW
99114
UINT DevAdapter;
100115
D3DDEVTYPE DevT;
101116
D3DPRESENT_PARAMETERS DevPP;
102-
#endif // USE_DX10
117+
#endif
103118

104119
#ifndef _MAYA_EXPORT
105120
stats_manager stats_manager;
106121
#endif
107-
#if defined(USE_DX10) || defined(USE_DX11)
122+
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
108123
void UpdateViews();
124+
#endif
125+
#if defined(USE_DX10) || defined(USE_DX11)
109126
DXGI_RATIONAL selectRefresh(u32 dwWidth, u32 dwHeight, DXGI_FORMAT fmt);
110127

111128
virtual void OnAppActivate();
112129
virtual void OnAppDeactivate();
113-
#endif // USE_DX10
130+
#endif
114131

115132
private:
116133
bool m_move_window;

0 commit comments

Comments
 (0)