www.pudn.com > music_spring.rar > springView.h


// springView.h : interface of the CSpringView class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_SPRINGVIEW_H__A3227252_9837_4324_B1BD_CD0873DD9BA0__INCLUDED_) 
#define AFX_SPRINGVIEW_H__A3227252_9837_4324_B1BD_CD0873DD9BA0__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include "glut.h" 
#include "Wave.h" 
#include "Afxtempl.h" 
typedef struct   
{ 
	float x; 
	float y; 
	float z; 
}Pos; 
typedef struct  
 { 
	float xspeed; 
	float yspeed; 
	float zspeed; 
}Speed; 
typedef struct  
 { 
	float xgravity; 
	float ygravity; 
	float zgravity; 
}Gravity; 
typedef struct  
 { 
	float r; 
	float g; 
	float b; 
	float a; 
}Color; 
typedef struct  
 { 
	float life; 
	float fade; 
	Pos pos; 
	Speed speed; 
	Gravity gravity; 
	Color color; 
}Particle; 
class CSpringView : public CView 
{ 
protected: // create from serialization only 
	CSpringView(); 
	DECLARE_DYNCREATE(CSpringView) 
 
// Attributes 
public: 
	CSpringDoc* GetDocument(); 
 
// Operations 
public: 
	HGLRC setUpOpengl(); 
	void InitGL(); 
	void drawSence(); 
	void loadTexture(char* str); 
	 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CSpringView) 
	public: 
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view 
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 
	protected: 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CSpringView(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CSpringView) 
	afx_msg BOOL OnEraseBkgnd(CDC* pDC); 
	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 OnLightC(); 
	afx_msg void OnLightO(); 
	afx_msg void OnMusicC(); 
	afx_msg void OnChange(); 
	afx_msg void OnLow(); 
	afx_msg void OnMedia(); 
	afx_msg void OnHigh(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
private: 
	HGLRC m_hrc; 
	Particle particle[6000]; 
	int t; 
	GLuint TEXTURE; 
	CWave wave; 
	BOOL blight; 
//	CListlist; 
	int number; 
}; 
 
#ifndef _DEBUG  // debug version in springView.cpp 
inline CSpringDoc* CSpringView::GetDocument() 
   { return (CSpringDoc*)m_pDocument; } 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_SPRINGVIEW_H__A3227252_9837_4324_B1BD_CD0873DD9BA0__INCLUDED_)