1 #ifndef __CUIOGLWINDOW_H__
2 #define __CUIOGLWINDOW_H__
3 
4 #include <CUI/CUIWindow.h>
5 #include <GL/gl.h>
6 
7 class CUIExport CUIOGLWindow : public CUIWindow
8 {
9 	public:
10 		CUIOGLWindow(void);
11 		CUIOGLWindow(CUCSTR, HINSTANCE, int, int, int, int);
12 		CUIOGLWindow(CUIWindow*, int, int, int, int);
13 
14 		virtual void perspectiveView(void);
15 		void orthoView(void);
16 		void setFieldOfView(double fov, float nClip, float fClip);
17 		BOOL initWindow(void);
isInitializedGL(void)18 		BOOL isInitializedGL(void) { return initializedGL; }
19 
20 		static const char *interpretGLError(GLenum errorCode);
21 	protected:
22 		~CUIOGLWindow(void);
23 		virtual void dealloc(void);
24 		void init(void);
25 		virtual BOOL setupPFD(void);
26 		virtual BOOL setPixelFormat(int pfIndex);
27 		virtual BOOL setupRenderingContext(void);
28 		virtual void initFail(char*);
29 		virtual void destroyWindow(void);
30 		virtual void makeCurrent(void);
31 		void initGL(void);
32 		virtual void setupLighting(void);
33 		virtual void setupLight(GLenum);
34 		virtual void setupMaterial(void);
35 		virtual void sizeView(void);
36 		virtual void drawLights(void);
37 		virtual void drawLight(GLenum, TCFloat, TCFloat, TCFloat);
38 
39 		virtual LRESULT doSize(WPARAM, int, int);
40 		virtual LRESULT doCreate(HWND, LPCREATESTRUCT);
41 		virtual LRESULT doNCDestroy(void);
42 		virtual LRESULT doDestroy(void);
43 
44 		int pfIndex;
45 		HGLRC hglrc;
46 		double fieldOfView;
47 		float nearClipPlane;
48 		float farClipPlane;
49 		BOOL initializedGL;
50 		BOOL hasParent;
51 };
52 
53 #endif
54