home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry2.iso / Cube Drop 2001 1.0 / 3DFontView.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-03-17  |  2.6 KB  |  105 lines

  1. /*
  2. Authors: David Nishimoto and Thomas Lee
  3. Website: http://www.listensoftware.com
  4. Program: Cube Drop
  5. */
  6.  
  7. #if !defined(AFX_3DFONTVIEW_H__4431AE0D_2C62_11D3_955D_8422F5C00000__INCLUDED_)
  8. #define AFX_3DFONTVIEW_H__4431AE0D_2C62_11D3_955D_8422F5C00000__INCLUDED_
  9.  
  10. #if _MSC_VER >= 1000
  11. #pragma once
  12. #endif // _MSC_VER >= 1000
  13. #include <gl/gl.h>
  14. #include "..\common\GLFont.h"
  15.  
  16.  
  17. class CMy3DFontView : public CView
  18. {
  19. protected: // create from serialization only
  20.     CMy3DFontView();
  21.     DECLARE_DYNCREATE(CMy3DFontView)
  22.  
  23. // Attributes
  24. public:
  25.     CMy3DFontDoc* GetDocument();
  26.  
  27. // Operations
  28. public:
  29.  
  30.     void drawWithOpenGL();
  31.     void drawCubes();
  32.     void setPerspectiveWindow(GLdouble fovy, GLdouble aspect,GLdouble zNear,GLdouble zFar);
  33.     void setViewport(GLint iX, GLint iY, GLsizei iWidth, GLsizei iHeight);
  34.     void setDepthBuffer();
  35.     void startGame();
  36.     void drawGrid();
  37.     void autoRotateDisplay();
  38.     void setSpeed();
  39. // Overrides
  40.     // ClassWizard generated virtual function overrides
  41.     //{{AFX_VIRTUAL(CMy3DFontView)
  42.     public:
  43.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  44.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  45.     protected:
  46.     //}}AFX_VIRTUAL
  47.  
  48. // Implementation
  49. public:
  50.     virtual ~CMy3DFontView();
  51. #ifdef _DEBUG
  52.     virtual void AssertValid() const;
  53.     virtual void Dump(CDumpContext& dc) const;
  54. #endif
  55.  
  56. protected:
  57.  
  58.     float m_shininess;
  59.     float m_Lightposition[4];
  60.     float m_Lightspecular[4];
  61.     float m_Lightdiffuse[4];
  62.     float m_Lightambient[4];
  63.     
  64.     
  65.     CPalette m_Palette; //the logic palette
  66.     HGLRC    m_hRC;
  67.     CDC*     m_pDC;
  68.  
  69.     CGLFont  m_FontX;
  70.  
  71.  
  72.     void InitPalette(void);
  73.     void DrawGLFont(void);
  74.     void InitFontColor(void);
  75.  
  76. // Generated message map functions
  77. protected:
  78.     //{{AFX_MSG(CMy3DFontView)
  79.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  80.     afx_msg void OnDestroy();
  81.     afx_msg void OnSize(UINT nType, int cx, int cy);
  82.     afx_msg void OnTimer(UINT nIDEvent);
  83.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  84.     afx_msg void OnViewAuto();
  85.     afx_msg void OnViewDefault();
  86.     afx_msg void OnFilePause();
  87.     afx_msg void OnFileNew();
  88.     afx_msg void OnFileResume();
  89.     afx_msg void OnViewAutostop();
  90.     //}}AFX_MSG
  91.     DECLARE_MESSAGE_MAP()
  92. };
  93.  
  94. #ifndef _DEBUG  // debug version in 3DFontView.cpp
  95. inline CMy3DFontDoc* CMy3DFontView::GetDocument()
  96.    { return (CMy3DFontDoc*)m_pDocument; }
  97. #endif
  98.  
  99. /////////////////////////////////////////////////////////////////////////////
  100.  
  101. //{{AFX_INSERT_LOCATION}}
  102. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  103.  
  104. #endif // !defined(AFX_3DFONTVIEW_H__4431AE0D_2C62_11D3_955D_8422F5C00000__INCLUDED_)
  105.