⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snakessubsonicview.h

📁 用opengl编写的简单贪吃蛇游戏
💻 H
字号:
// SnakesSubsonicView.h : interface of the CSnakesSubsonicView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_SNAKESSUBSONICVIEW_H__BFF27DE9_F019_485B_BA2D_9840D995BF71__INCLUDED_)
#define AFX_SNAKESSUBSONICVIEW_H__BFF27DE9_F019_485B_BA2D_9840D995BF71__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Snake.h"
#include "glut.h"
#include "GLFont.h"

class CSnakesSubsonicView : public CView
{
protected: // create from serialization only
	CSnakesSubsonicView();
	DECLARE_DYNCREATE(CSnakesSubsonicView)

// Attributes
public:
	CSnakesSubsonicDoc* GetDocument();
	CClientDC *m_pDC;
	HGLRC m_hRC;

	UINT TextureImage[4];
	UINT fruit[12];
	GLuint headimage;

	CGLFont* Font;
	HFONT hFont;

	Snake snk;

	BOOL timer;

	BOOL GameOver;

	double glw,glh,sw,sh;
	BOOL isOnSize;

// Operations
public:
	BOOL LoadBMP(char *Filename, GLuint &texture);
	void LoadT16(char *Filename, GLuint &texture);
	BOOL bSetupPixelFormat(void);
	void DrawBorderTree();
	void glRect(double l, double fovy);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSnakesSubsonicView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CSnakesSubsonicView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CSnakesSubsonicView)
	afx_msg void OnDestroy();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in SnakesSubsonicView.cpp
inline CSnakesSubsonicDoc* CSnakesSubsonicView::GetDocument()
   { return (CSnakesSubsonicDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SNAKESSUBSONICVIEW_H__BFF27DE9_F019_485B_BA2D_9840D995BF71__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -