OpenGLMFCView.h
上传用户:yanjing
上传日期:2022-06-12
资源大小:36k
文件大小:2k
源码类别:

OpenGL

开发平台:

Visual C++

  1. // OpenGLMFCView.h : interface of the COpenGLMFCView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_OPENGLMFCVIEW_H__787A9476_55B6_4B22_A48D_12179EF8B799__INCLUDED_)
  5. #define AFX_OPENGLMFCVIEW_H__787A9476_55B6_4B22_A48D_12179EF8B799__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. /////////////////////////////////////////////
  10. #include <gl/gl.h>
  11. #include <gl/glu.h>
  12. #include <gl/glaux.h>
  13. #include <math.h>
  14. /////////////////////////////////////////////
  15. class COpenGLMFCView : public CScrollView
  16. {
  17. protected: // create from serialization only
  18. COpenGLMFCView();
  19. DECLARE_DYNCREATE(COpenGLMFCView)
  20. // Attributes
  21. public:
  22. COpenGLMFCDoc* GetDocument();
  23. //*******************************************
  24. public:
  25. HGLRC hglrc;
  26. void drawwithopengl(void);
  27. //*******************************************
  28. // Operations
  29. public:
  30. // Overrides
  31. // ClassWizard generated virtual function overrides
  32. //{{AFX_VIRTUAL(COpenGLMFCView)
  33. public:
  34. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  35. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  36. virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
  37. protected:
  38. virtual void OnInitialUpdate(); // called first time after construct
  39. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  40. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  41. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  42. //}}AFX_VIRTUAL
  43. // Implementation
  44. public:
  45. virtual ~COpenGLMFCView();
  46. #ifdef _DEBUG
  47. virtual void AssertValid() const;
  48. virtual void Dump(CDumpContext& dc) const;
  49. #endif
  50. protected:
  51. // Generated message map functions
  52. protected:
  53. //{{AFX_MSG(COpenGLMFCView)
  54. afx_msg void OnDestroy();
  55. afx_msg void OnSize(UINT nType, int cx, int cy);
  56. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  57. //}}AFX_MSG
  58. DECLARE_MESSAGE_MAP()
  59. };
  60. #ifndef _DEBUG  // debug version in OpenGLMFCView.cpp
  61. inline COpenGLMFCDoc* COpenGLMFCView::GetDocument()
  62.    { return (COpenGLMFCDoc*)m_pDocument; }
  63. #endif
  64. /////////////////////////////////////////////////////////////////////////////
  65. //{{AFX_INSERT_LOCATION}}
  66. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  67. #endif // !defined(AFX_OPENGLMFCVIEW_H__787A9476_55B6_4B22_A48D_12179EF8B799__INCLUDED_)