📄 fightertestview.h
字号:
// FighterTestView.h : interface of the CFighterTestView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MYSDOPENGLVIEW_H__75C5AAEC_37B0_4A8B_9132_9A0C663F6DDC__INCLUDED_)
#define AFX_MYSDOPENGLVIEW_H__75C5AAEC_37B0_4A8B_9132_9A0C663F6DDC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MAXPUF 1024
#define TIMEPUF 100
#define TEMPOVIRATA 400
#define DIMX 64
#define DIMZ 64
#define SIZE 256
#define MAXBULLET 100
#define GRAVITY 0.002
#include "Texture.h"
typedef struct
{
double x;
double y;
double z;
} Vector;
typedef struct {
float x;
float y;
float z;
float an;
float anend;
float dan;
float vel;
float fvirata;
bool virata;
int attivo;
int cntscia;
int tempovirata;
} AIR;
typedef struct {
float x;
float y;
float z;
float dim;
float r;
float g;
float b;
float time;
} SMOKE;
typedef struct {
bool active;
int explosion;
float x;
float y;
float z;
float dx;
float dy;
float dz;
float dim;
} BULLET;
class Model;
class CFighterTestView : public CView
{
protected: // create from serialization only
CFighterTestView();
DECLARE_DYNCREATE(CFighterTestView)
// Attributes
public:
CFighterTestDoc* GetDocument();
Model *pModel ; // Holds The Model Data
Texture m_texture;
GLUquadricObj *qobj;
bool active;
float Ioan;
bool sky;
int timebullet;
int cameratype;
bool smoke;
int nb;
Vector Io;
Vector Terrain[DIMX][DIMZ]; // 地形
AIR aereo; // 飞机
SMOKE Smoke[MAXPUF]; //
BULLET bul[MAXBULLET]; // 子弹
// Operations
public:
int InitGL(GLvoid); // All Setup For OpenGL Goes Here
double VectorLength( Vector v );
Vector VectorNormalize( Vector v );
Vector VectorMultiply( Vector v1, Vector v2 );
Vector VectorScalarMultiply( Vector v, double s );
Vector VectorDiff( Vector v1, Vector v2 );
void Luce(double x, double y, double z,double dimensione,float r,float g,float b,float iox,float ioy,float ioz,int Tex);
void InitBullet(void); // 初始化子弹
void InitTerrain(void); // 初始化地形
void InitAereo(void); // 初始化飞机
void InitSmoke01(void);
void ActiveBullet(void);
void InitSmoke02(void);
void MoveDrawBullet(void);
void MoveAereo(void);
void DrawTerrain(void);
void DrawAereo(void);
void DrawSmoke(void);
void Camera(void);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFighterTestView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
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 ~CFighterTestView();
/////////////////////////////////////////////////////////////////
//添加成员函数与成员变量
BOOL RenderScene();
BOOL SetupPixelFormat(void);
void SetLogicalPalette(void);
BOOL InitializeOpenGL(CDC* pDC);
HGLRC m_hRC; //OpenGL绘制描述表
HPALETTE m_hPalette; //OpenGL调色板
CDC* m_pDC; //OpenGL设备描述表
/////////////////////////////////////////////////////////////////
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CFighterTestView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in FighterTestView.cpp
inline CFighterTestDoc* CFighterTestView::GetDocument()
{ return (CFighterTestDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MYSDOPENGLVIEW_H__75C5AAEC_37B0_4A8B_9132_9A0C663F6DDC__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -