📄 glview.h
字号:
// GLView.h : interface of the CGLView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GLVIEW_H__B2996431_1A48_492F_87B8_D8E922845B95__INCLUDED_)
#define AFX_GLVIEW_H__B2996431_1A48_492F_87B8_D8E922845B95__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CGLView : public CView
{
protected: // create from serialization only
CGLView();
DECLARE_DYNCREATE(CGLView)
// Attributes
public:
CGLDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGLView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL
// Implementation
public:
virtual void RenderScene();//用OpenGL绘制图形的成员函数
virtual ~CGLView();
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGLView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void GLInit();//OpenGL的初始化设置(RC,像素格式等)
void GLRelease();//删除RC
void GLResize(int cx,int cy);//根据视图窗口尺寸的变化,调整OpenGL的显示空间
void GLSetupRC();//设置RC
HGLRC m_hRC; //加入成员变量:rendering context
HDC m_hDC; //加入成员变量:device context
};
#ifndef _DEBUG // debug version in GLView.cpp
inline CGLDoc* CGLView::GetDocument()
{ return (CGLDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GLVIEW_H__B2996431_1A48_492F_87B8_D8E922845B95__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -