home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 July & August / PCWorld_2006-07-08_cd.bin / temacd / planearcade / planearcade.exe / Tank3.bmp / particles.h < prev    next >
C/C++ Source or Header  |  2004-01-22  |  1KB  |  55 lines

  1.  
  2. #ifndef _PARTICLES_H_
  3. #define _PARTICLES_H_
  4.  
  5. //-----------------------------------
  6. //CUSTOMVERTEX
  7. //------------------------------------
  8. struct CUSTOMVERTEXPARTICLE
  9. {
  10.     D3DXVECTOR3 pos; 
  11.     D3DCOLOR    color;  
  12.     FLOAT       tu, tv;   
  13. };
  14.  
  15. //CUSTOMVERTEXT
  16. #define D3DFVF_CUSTOMVERTEXPARTICLE (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
  17.  
  18.  
  19. //------------------------------------------------------------------
  20. // Name: PARTICLE CLASS
  21. // Desc: **************
  22. //------------------------------------------------------------------
  23. class PARTICLE
  24. {
  25. private:
  26.  
  27.     //partile
  28.     CUSTOMVERTEXPARTICLE *Vertex; //vertexy do ktorych sa uklada
  29.     LPDIRECT3DTEXTURE9   *g_pTexture; //textura
  30.     LPDIRECT3DVERTEXBUFFER9 g_pVB;  //vertex buffer
  31.     int *TextureID;  //id textury
  32.  
  33.     int ActParticle; //aktualny partice
  34.     int ActVertex; //aktualny vertex pri budovani particlov
  35.  
  36.     int MaxParticles;
  37.     int MaxFrames;
  38.  
  39. public:
  40.  
  41.     PARTICLE();
  42.     ~PARTICLE();
  43.  
  44.     void Initialize(int MParticles,int MFrames);
  45.     void AddFrame(int FrameID,char *FileName,COLOR ColorKey);
  46.  
  47.     void RenderParticle(VECTOR3D Pos,COLOR Color,float Size,float Rotation,float Frame);
  48.     void RenderParticleSprite(VECTOR3D Pos,VECTOR3D Normal,COLOR Color,float Size,float Frame);
  49.     void Render();
  50.  
  51.  
  52. };
  53.  
  54.  
  55. #endif // _PARTICLES_H_