00001 #pragma once
00002
00008 #include "WGL.h"
00009 #include "ExClass.h"
00010 #include <mmsystem.h>
00011
00012
00013 #ifdef ENABLE_OPENGL
00014
00015
00016
00017 namespace jbxwl {
00018
00019
00021
00022
00023 class CGlBaseView : public CExView
00024 {
00025 public:
00026 HGLRC m_hRC;
00027 CDC* m_pDC;
00028
00029 PIXELFORMATDESCRIPTOR glParam;
00030
00031 public:
00032 CGlBaseView();
00033 virtual ~CGlBaseView();
00034
00035 protected:
00036 virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
00037
00038 public:
00039 virtual void OnInitialUpdate(void) {}
00040 virtual void SetState(void) {}
00041 virtual void ExecRender(void) {}
00042
00043
00044 virtual void InitObject(void) { SetState();}
00045 virtual void SetParameter(PIXELFORMATDESCRIPTOR* pfd);
00046
00047 POINT GetWindowDisplaySize(POINT pt);
00048 BOOL InitDevice(int xsize=0, int ysize=0, CWnd* cwnd=NULL);
00049
00050 virtual int GetMouseButton(void);
00051
00052 DECLARE_MESSAGE_MAP()
00053 afx_msg void OnSize(UINT nType, int cx, int cy);
00054 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00055 afx_msg void OnDestroy();
00056 virtual void OnDraw(CDC* pDC) { CExView::OnDraw(pDC);}
00057 };
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 }
00102
00103
00104
00105
00106 #endif // ENABLE_OPENGL