Snow.h
资源名称:3DRPG.rar [点击查看]
上传用户:cjwanglu
上传日期:2013-07-10
资源大小:4744k
文件大小:1k
源码类别:
游戏
开发平台:
Visual C++
- #include <d3dx9.h>
- #include <d3d9.h>
- #define D3DFVF_SNOWVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE)
- inline DWORD FtoDW(float f) {return (*(DWORD*)&f);}
- class CSnow
- {
- public:
- CSnow(LPDIRECT3DDEVICE9 d3dd,DWORD Lenth,DWORD Width,DWORD Height,DWORD Density,float offset);
- virtual ~CSnow();
- void MoveSnow(D3DXVECTOR3 k,D3DXVECTOR3 j);
- void RenderSnow();
- private:
- LPDIRECT3DDEVICE9 m_pD3DDevice;
- LPDIRECT3DVERTEXBUFFER9 m_pVb;
- LPDIRECT3DTEXTURE9 m_pTx;
- D3DMATERIAL9 mtrl;
- DWORD m_dwLenth;
- DWORD m_dwWidth;
- DWORD m_dwHeight;
- DWORD m_dwDensity;
- float m_fOffset;
- long m_lSnowCount;
- void InitialSnow();
- void DrawSnow();
- void SetMaterial();
- struct SNOWVERTEX
- {
- D3DXVECTOR3 p;
- D3DCOLOR color;
- };
- };