0001:
0002:
0003:
0004:
0005:
0006: #ifndef GLAPP_H
0007: #define GLAPP_H
0008:
0009: #pragma warning(disable : 4136)
0010:
0011: #include <GL/gl.h>
0012: #include <GL/glu.h>
0013:
0014:
0015: typedef struct _D3DSURFACE_DESC {
0016:
0017:
0018:
0019:
0020:
0021:
0022: UINT Width;
0023: UINT Height;
0024: } MY_SURFACE_DESC;
0025:
0026:
0027:
0028:
0029:
0030:
0031: class CD3DApplication
0032: {
0033: bool m_bDeviceObjectsInited;
0034: bool m_bDeviceObjectsRestored;
0035: HRESULT HandlePossibleSizeChange();
0036: HRESULT Reset3DEnvironment();
0037: HRESULT Initialize3DEnvironment();
0038: void Cleanup3DEnvironment();
0039: HRESULT Render3DEnvironment();
0040:
0041: protected:
0042: HWND m_hWnd;
0043: BOOL m_bGL;
0044: MY_SURFACE_DESC m_mysdBackBuffer;
0045: DWORD m_dwWindowStyle;
0046: RECT m_rcWindowBounds;
0047: RECT m_rcWindowClient;
0048:
0049: TCHAR* m_strWindowTitle;
0050: FLOAT m_fTime;
0051: FLOAT m_fElapsedTime;
0052: DWORD m_dwCreationWidth;
0053: DWORD m_dwCreationHeight;
0054:
0055:
0056: virtual HRESULT ConfirmDevice(void*,DWORD,void*) { return S_OK; }
0057: virtual HRESULT OneTimeSceneInit() { return S_OK; }
0058: virtual HRESULT InitDeviceObjects() { return S_OK; }
0059: virtual HRESULT RestoreDeviceObjects() { return S_OK; }
0060: virtual HRESULT FrameMove() { return S_OK; }
0061: virtual HRESULT Render() { return S_OK; }
0062: virtual HRESULT InvalidateDeviceObjects() { return S_OK; }
0063: virtual HRESULT DeleteDeviceObjects() { return S_OK; }
0064: virtual HRESULT FinalCleanup() { return S_OK; }
0065: public:
0066: HRESULT Create( HINSTANCE hInst, int nCmdShow );
0067: INT Run();
0068: virtual LRESULT MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
0069:
0070: CD3DApplication();
0071: };
0072:
0073: #endif
0074:
0075: