Skip to content

Commit

Permalink
xrRenderGL: Implement glHW to replace glRenderDeviceRender.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Nov 21, 2015
1 parent 2ea745c commit 161f67a
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 18 deletions.
29 changes: 23 additions & 6 deletions src/Layers/xrRender/HW.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,29 @@ class CHW
CHW();
~CHW();

#ifndef USE_OGL
void CreateD3D ();
void DestroyD3D ();
#endif // !USE_OGL
void CreateDevice (HWND hw, bool move_window);

void DestroyDevice ();

void Reset (HWND hw);

#ifndef USE_OGL
void selectResolution (u32 &dwWidth, u32 &dwHeight, BOOL bWindowed);
D3DFORMAT selectDepthStencil (D3DFORMAT);
u32 selectPresentInterval ();
u32 selectGPU ();
u32 selectRefresh (u32 dwWidth, u32 dwHeight, D3DFORMAT fmt);
void updateWindowProps (HWND hw);
BOOL support (D3DFORMAT fmt, DWORD type, DWORD usage);
#endif // !USE_OGL

void updateWindowProps(HWND hw);

#ifdef DEBUG
#if defined(USE_DX10) || defined(USE_DX11)
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
void Validate(void) {};
#else // USE_DX10
void Validate(void) { VERIFY(pDevice); VERIFY(pD3D); };
Expand All @@ -50,7 +55,17 @@ class CHW
#endif

// Variables section
#if defined(USE_DX11) // USE_DX10
#if defined(USE_OGL)
public:
CHW* pDevice;
GLuint pBaseZB;

CHWCaps Caps;

HWND m_hWnd;
HDC m_hDC;
HGLRC m_hRC;
#elif defined(USE_DX11)
public:
IDXGIAdapter* m_pAdapter; // pD3D equivalent
ID3D11Device* pDevice; // combine with DX9 pDevice via typedef
Expand Down Expand Up @@ -99,18 +114,20 @@ class CHW
UINT DevAdapter;
D3DDEVTYPE DevT;
D3DPRESENT_PARAMETERS DevPP;
#endif // USE_DX10
#endif

#ifndef _MAYA_EXPORT
stats_manager stats_manager;
#endif
#if defined(USE_DX10) || defined(USE_DX11)
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
void UpdateViews();
#endif
#if defined(USE_DX10) || defined(USE_DX11)
DXGI_RATIONAL selectRefresh(u32 dwWidth, u32 dwHeight, DXGI_FORMAT fmt);

virtual void OnAppActivate();
virtual void OnAppDeactivate();
#endif // USE_DX10
#endif

private:
bool m_move_window;
Expand Down
Loading

0 comments on commit 161f67a

Please sign in to comment.