www.pudn.com > 3DEarth.rar > 3DWND.H
#if !defined(AFX_3DWND_H__B847A96B_ADF0_492E_8BE6_01D178FD709B__INCLUDED_) #define AFX_3DWND_H__B847A96B_ADF0_492E_8BE6_01D178FD709B__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // 3dwnd1.h : header file // #include#include #pragma comment(lib,"d3d8.lib") #pragma comment(lib,"d3dx8.lib") #define US_DRAW 1001 #define BALLFACE 30 ///////////////////////////////////////////////////////////////////////////// // C3dwnd window class C3dwnd : public CWnd { // Construction public: C3dwnd(); // Attributes public: struct BALLVERTEX { D3DXVECTOR3 vpos; //坐标 D3DXVECTOR3 vnor; //法向 DWORD dclr; //颜色 DWORD sclr; //颜色 float tu,tv; //纹理 }; public: RECT g_rect; LPDIRECT3D8 g_pD3D; LPDIRECT3DDEVICE8 g_pD3DDevice; float angx,angy,anglight,danglight; int curx,cury; BOOL bpin; D3DXMATRIX g_matView; D3DMATERIAL8 ball_mtrl; LPDIRECT3DVERTEXBUFFER8 pBallData; // LPDIRECT3DTEXTURE8 pBallTex; LPDIRECT3DVERTEXBUFFER8 pAirData; // LPDIRECT3DTEXTURE8 pAirTex; LPD3DXFONT g_pFont; HFONT hFont; UINT g_ti,g_fps; CString s_fps; // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(C3dwnd) //}}AFX_VIRTUAL // Implementation public: LPDIRECT3DVERTEXBUFFER8 PrepairBallData(float R); HRESULT PrepairLight(); HRESULT PrepairMaterial(); HRESULT PrepairTexture(); HRESULT PrepairVertex(); HRESULT DrawScene(); HRESULT InitialiseD3D(); BOOL CreateWnd(CWnd* parent,RECT& rect); virtual ~C3dwnd(); // Generated message map functions protected: //{{AFX_MSG(C3dwnd) afx_msg void OnDestroy(); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnTimer(UINT nIDEvent); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_3DWND_H__B847A96B_ADF0_492E_8BE6_01D178FD709B__INCLUDED_)