-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleManager.h
More file actions
58 lines (45 loc) · 1.46 KB
/
ParticleManager.h
File metadata and controls
58 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once/+
#include "ParticleHelper.h"
#include "Particle.h"
#include "Camera.h"
struct CB_stuff : public constB {
struct {
float element;
}time;
struct {
float element;
}random;
struct {
float element[2];
}padding;
};
class ParticleManager
{
public:
/*max number of particles must be a multiple of 8 else the code is going to to it for you*/
ParticleManager(ID3D11Device* device, ID3D11ShaderResourceView* SRV, int numberOfParticles, Camera& camera, vector_3 orgin = vector_3(0, 0, 0), vector_3 sizeofArea = vector_3(0, 0, 0));
virtual ~ParticleManager();
void Update(float dt, ID3D11DeviceContext* context);
void ShaderUpdater(ID3D11DeviceContext* context, Camera& camera);
void Draw(ID3D11DeviceContext* context, ID3D11InputLayout* layout);
std::string GetVShaderData();
private:
int numberOfParticles;
CB_stuff trpConstantBuffer; //time, random, padding
vector_3 position;
ParticleMovement movement;
ID3D11ShaderResourceView* SRV;
std::vector<point> particles;
ID3D11ComputeShader* computeShaderUpdate;
ID3D11UnorderedAccessView* particleUAV;
ID3D11Buffer* bufferManager;
ID3D11Buffer* GeoConstantBuffer;
ID3D11Buffer* PixelConstantBuffer;
ID3D11Buffer* VertexConstantBuffer;
ID3D11Buffer* CConstantBuffer;
ID3D11GeometryShader* geoShader;
ID3D11PixelShader* pShader;
ID3D11VertexShader* vShader;
void createShaders(ID3D11Device* device);
std::string vertexShaderByteCode;
};