Определение версии класса RMWin, используемой в приложении MultiView, приведено в листинге 9.5.
Листинг 9.5. Определение класса RMWin | |
class RMWin : public CFrameWnd { public: RMWin(); RMWin(int w,int h); BOOL Create(const CString& sTitle,int icon,int menu); void SetColorModel(D3DCOLORMODEL cm ) { colormodel = cm; } inline COLORREF D3DCOLOR_2_COLORREF(D3DCOLOR d3dclr); inline D3DCOLOR COLORREF_2_D3DCOLOR(COLORREF cref); void Render(); protected: static int GetMouseX() { return mousex; } static int GetMouseY() { return mousey; } void ScaleMesh(LPDIRECT3DRMMESHBUILDER, D3DVALUE); protected: //{{AFX_MSG(RMWin) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnDestroy(); afx_msg void OnActivate(UINT state, CWnd* other, BOOL minimize); afx_msg void OnPaint(); afx_msg void OnSize(UINT type, int cx, int cy); afx_msg void OnMouseMove(UINT state, CPoint point); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnViewport1Disabled(); afx_msg void OnViewport1Front(); afx_msg void OnViewport1Left(); afx_msg void OnViewport1Right(); afx_msg void OnViewport1Top(); afx_msg void OnViewport2Disabled(); afx_msg void OnViewport2Front(); afx_msg void OnViewport2Left(); afx_msg void OnViewport2Right(); afx_msg void OnViewport2Top(); afx_msg void OnViewport3Disabled(); afx_msg void OnViewport3Front(); afx_msg void OnViewport3Left(); afx_msg void OnViewport3Right(); afx_msg void OnViewport3Top(); afx_msg void OnUpdateViewport1Disabled(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport1Front(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport1Left(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport1Right(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport1Top(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport2Disabled(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport2Front(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport2Left(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport2Right(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport2Top(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport3Disabled(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport3Front(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport3Left(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport3Right(CCmdUI* pCmdUI); afx_msg void OnUpdateViewport3Top(CCmdUI* pCmdUI); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: void Initvars(); virtual BOOL CreateScene() = 0; BOOL CreateDevice(); GUID* GetGUID(); void ConfigViewport(LPDIRECT3DRMFRAME camera, int view); void CreateViewports(); protected: static LPDIRECT3DRM d3drm; LPDIRECT3DRMFRAME scene; LPDIRECT3DRMDEVICE device; D3DCOLORMODEL colormodel; private: LPDIRECT3DRMFRAME camera1, camera2, camera3; LPDIRECT3DRMVIEWPORT viewport1, viewport2, viewport3; int view1setting, view2setting, view3setting; CRect winrect; LPDIRECTDRAWCLIPPER clipper; static int mousex; static int mousey; static UINT mousestate; friend class RMApp; }; |