1 #ifndef particle_buffer_header
 2 #define particle_buffer_header
 3 
 4 #include "openGL.h"
 5 #include "constraints.h"
 6 #include "particle.h"
 7 #include "application.h"
 8 
 9 //--------------------------------------
10 // Var: point_texture
11 // Desc: texture used for particle texture
12 //--------------------------------------
13 extern GLuint point_texture;
14 
15 //--------------------------------------
16 // Struct: particleBuffer
17 // Desc: encapsulates the particles
18 // and constraints in the system
19 //--------------------------------------
20 typedef struct particleBuffer
21 {
22 	Particle* particles;	
23 	int maxParticles;
24 	int curParticles;
25 
26 	Constraint* constraints;
27 	int constraints_dim;
28 
29 } ParticleBuffer;
30 
31 //--------------------------------------
32 // Function: particleBuffer_init
33 // Desc: initialises a particle_buffer
34 // allocating memory for the max
35 // number of particles
36 //--------------------------------------
37 void particleBuffer_init  ( ParticleBuffer* particleBuffer, int maxParticles );
38 
39 //--------------------------------------
40 // Function: particleBuffer_copy
41 // Desc: copies the contents of one
42 // particle_buffer to another.
43 // if new_pb is true it will allocate
44 // memory for the particles
45 //--------------------------------------
46 void particleBuffer_copy  ( ParticleBuffer* particleBuffer, ParticleBuffer* particleBuffer_out, bool new_pb );
47 
48 //--------------------------------------
49 // Function: particleBuffer_delete
50 // Desc: frees the memory used by the 
51 // the particle_buffer. 
52 // [not implemented]
53 //--------------------------------------
54 void particleBuffer_delete( ParticleBuffer* particleBuffer );
55 
56 //--------------------------------------
57 // Function: particleBuffer_solve
58 // Desc: solves the particle buffer
59 // over timeStep
60 //--------------------------------------
61 void particleBuffer_solve ( ParticleBuffer* particleBuffer, float timeStep );
62 
63 //--------------------------------------
64 // Function: particleBuffer_draw
65 // Desc: draws the particles and 
66 // constraints located inside the
67 // particle buffer
68 //--------------------------------------
69 void particleBuffer_draw  ( ParticleBuffer* particleBuffer );
70 
71 #endif


syntax highlighted by Code2HTML, v. 0.9.1