raSystem  1.0 bata
raGPUParticleSystem.h
Go to the documentation of this file.
1 #pragma once
2 
4  {
5  public:
6  static const int MAXPARTICLES = 100;
7  public:
8  raGPUParticleSystem(raDirectX *dx, LPCSTR ParticleTexture = "raGrafik\\particlered.bmp",
9  LPCSTR EffectFile = "raEffects\\ParticleEffect.fx",
10  LPCSTR Technique = "RenderParticle");
11 
12  raGPUParticleSystem(raDirectX *dx, raMaterial *ParticleMat);
13 
15 
16  virtual bool CreateMesh() { return m_pCS->Create(); }
17  virtual bool DestroyMesh() { m_pCS->Destroy(); return true; }
18 
19  virtual void SetupEffectVariables(const raMatrix& pView, const raMatrix& pProj,
20  const raLight* pLight);
21 
22  virtual bool RenderMesh(LPCSTR techniqueName = "");
23 
24  virtual bool Update(float fTime, float fRunTime)
25  {
26  return m_pCS->RunCS(MAXPARTICLES, 1, 1);
27  }
28 
29  //IMesh-Funktionen
30  virtual UINT GetNumSubsets(){return 1;}
31  virtual SDKMESH_SUBSET* GetSubset(UINT n){return NULL;}
32 
33  virtual const D3D11_INPUT_ELEMENT_DESC* GetVertexLayout(){return PARTICLEVERTEX::GetVertexLayout();}
35 
36  virtual ID3D11Buffer* GetVertexBuffer(){return m_pCS->GetBuffer();}
37  virtual ID3D11Buffer* GetIndexBuffer(){return NULL;}
38  virtual UINT GetStrideSize(){return sizeof(PARTICLEVERTEX);}
39 
40  virtual DXGI_FORMAT GetIndexBufferFormat(){return DXGI_FORMAT_R32_TYPELESS;}
41  virtual D3D11_PRIMITIVE_TOPOLOGY GetPrimitiveTopology(UINT n)
42  {
43  return D3D11_PRIMITIVE_TOPOLOGY_POINTLIST;
44  }
45 
46  //Dummy-Implementierung
47  virtual bool Intersects(const raVector3* pRayPos,
48  const raVector3* pRayDir,
49  float* pDist){return false;}
50  protected:
52  std::vector<PARTICLEVERTEX> m_Particles;
54  };
virtual UINT GetStrideSize()
virtual ID3D11Buffer * GetVertexBuffer()
static D3D11_INPUT_ELEMENT_DESC * GetVertexLayout()
Definition: raVectexType.h:161
virtual UINT GetNumSubsets()
Definition: raLight.h:5
virtual bool Update(float fTime, float fRunTime)
virtual bool DestroyMesh()
#define RAPI
Definition: raMain.h:11
virtual void SetupEffectVariables(const raMatrix &pView, const raMatrix &pProj, const raLight *pLight)
Definition: raVisual.cpp:117
static UINT GetNumElements()
Definition: raVectexType.h:177
virtual bool RenderMesh(LPCSTR techniqueName="")=0
virtual D3D11_PRIMITIVE_TOPOLOGY GetPrimitiveTopology(UINT n)
virtual bool CreateMesh()
virtual DXGI_FORMAT GetIndexBufferFormat()
virtual UINT GetNumElements()
virtual const D3D11_INPUT_ELEMENT_DESC * GetVertexLayout()
virtual bool Intersects(const raVector3 *pRayPos, const raVector3 *pRayDir, float *pDist)
std::vector< PARTICLEVERTEX > m_Particles
virtual SDKMESH_SUBSET * GetSubset(UINT n)
virtual ID3D11Buffer * GetIndexBuffer()
#define SAFE_DELETE(p)
Definition: d3dxGlobal.h:26