00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <afxwin.h>
00031 #include <GL/gl.h>
00032 #include <GL/glu.h>
00033 #include <cmath>
00034
00035 #include <ivfwidget/IvfWidgetBase.h>
00036
00037 #include <ivfmfc/IvfMfcApplication.h>
00038
00039 IvfSmartPointer(CIvfMfcWindow);
00040
00049 class CIvfMfcWindow: public CFrameWnd, public CIvfWidgetBase {
00050 private:
00051 HDC m_hgldc;
00052 HGLRC m_hglRC;
00053
00054 LARGE_INTEGER m_countsPerSec;
00055 double m_elapsedTime;
00056 double m_zeroTime;
00057
00058 int m_size[2];
00059 int m_pos[2];
00060 int m_colorBits;
00061
00062 int m_mousePos[2];
00063
00064 CIvfMfcApplicationBase* m_application;
00065
00066 double largeToDouble(LARGE_INTEGER &value);
00067 public:
00076 CIvfMfcWindow(int X, int Y, int W, int H);
00077
00079 virtual ~CIvfMfcWindow();
00080
00082 void setApplication(CIvfMfcApplicationBase* app);
00083
00085 BOOL SetPixelformat(HDC hdc);
00086
00088 virtual BOOL PreCreateWindow( CREATESTRUCT& cs );
00089
00090 virtual void doInit(int width, int height);
00091 virtual void doDestroy();
00092 virtual void doRedraw();
00093 virtual void doEnableTimeout(float time, int nbr);
00094 virtual void doDisableTimeout(int nbr);
00095 virtual void doDisableIdleProcessing();
00096 virtual void doEnableIdleProcessing();
00097 virtual double doElapsedTime();
00098 virtual void doSetPosition(int x, int y);
00099 virtual void doSetSize(int w, int h);
00100
00101 protected:
00102
00103 afx_msg void OnPaint();
00104 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00105 afx_msg void OnSize(UINT nType, int cx, int cy );
00106 afx_msg BOOL OnEraseBkgnd( CDC* pDC );
00107 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00108 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00109 afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00110 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
00111 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00112 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00113 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00114 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00115 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00116 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00117 afx_msg void OnClose();
00118 afx_msg void OnTimer(UINT nIDEvent);
00119
00120 DECLARE_MESSAGE_MAP()
00121 };