/* -*- c++ -*- FILE: MagicCube4dView.h RCS REVISION: $Revision: 1.8 $ COPYRIGHT: (c) 1999 -- 2003 Melinda Green, Don Hatch, and Jay Berkenbilt - Superliminal Software LICENSE: Free to use and modify for non-commercial purposes as long as the following conditions are adhered to: 1) Obvious credit for the source of this code and the designs it embodies are clearly made, and 2) Ports and derived versions of 4D Magic Cube programs are not distributed without the express written permission of the authors. DESCRIPTION: interface of the CMagicCube4dView class */ ///////////////////////////////////////////////////////////////////////////// #include "WrapD3D.h" #include "d3drm.h" #include "d3drmwin.h" #include "MagicCubeObj.h" class CMagicCube4dView : public CView { protected: // create from serialization only CMagicCube4dView(); DECLARE_DYNCREATE(CMagicCube4dView) // Attributes public: CMagicCube4dDoc* GetDocument(); private: WrapD3D m_wrapd3d; int m_width, m_height; IDirect3D* m_d3d; IDirect3DDevice* m_d3ddev; IDirect3DViewport* m_d3dview; IDirect3DRM* m_d3drm; IDirect3DRMFrame *m_scene, *m_objs, *m_camera, *m_lights; IDirectDrawClipper* m_clipper; IDirect3DRMDevice* m_d3drmdev; IDirect3DRMWinDevice* m_d3drmwindev; IDirect3DRMViewport* m_view; IDirect3DRMLight *m_dir_light, *m_amb_light; int m_nslices; MagicCubeObject* m_puzzle; bool m_left_mouse_down, m_left_dragged; bool m_update_needed; double m_last_point[2]; FILE* m_tmp_logfile; enum ScrambleState { SCRAMBLE_NONE, SCRAMBLE_PARTIAL, SCRAMBLE_FULL, } m_scramble_state; int m_user_twists; int m_user_twisting; int m_user_twist_mask; bool m_shift_down; bool m_software_render_only; void Init3D(int w, int h); void NewPuzzle(int ns); void Scramble(int scrambulations); void DoPick(int x, int y, int dir, int rotate); void InitDrawing(); // Operations public: BOOL Update3d(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMagicCube4dView) public: virtual void OnDraw(CDC* pDC); // overridden to draw this view protected: virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView); //}}AFX_VIRTUAL // Implementation public: virtual ~CMagicCube4dView(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Generated message map functions protected: //{{AFX_MSG(CMagicCube4dView) afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnEditUndo(); afx_msg void OnScramble1(); afx_msg void OnScramble2(); afx_msg void OnScramble3(); afx_msg void OnScramble4(); afx_msg void OnScramble5(); afx_msg void OnScramble6(); afx_msg void OnScramble7(); afx_msg void OnScramble8(); afx_msg void OnScrambleFull(); afx_msg void OnSolve(); afx_msg void OnReset(); afx_msg void OnNewPuzzle2(); afx_msg void OnNewPuzzle3(); afx_msg void OnNewPuzzle4(); afx_msg void OnNewPuzzle5(); afx_msg void OnFileSave(); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnRenderingSoftwareonly(); afx_msg void OnRenderingDefault(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; #ifndef _DEBUG // debug version in MagicCube4dView.cpp inline CMagicCube4dDoc* CMagicCube4dView::GetDocument() { return (CMagicCube4dDoc*)m_pDocument; } #endif ///////////////////////////////////////////////////////////////////////////// // Local Variables: // c-basic-offset: 4 // c-comment-only-line-offset: 0 // c-file-offsets: ((defun-block-intro . +) (block-open . 0) (substatement-open . 0) (statement-cont . +) (statement-case-open . +4) (arglist-intro . +) (arglist-close . +) (inline-open . 0)) // indent-tabs-mode: nil // End: