update helpers/location to 'frosted' ui
[carveJwlIkooP6JGAAIwe30JlM.git] / particle.h
1 #pragma once
2 #include "skaterift.h"
3
4 typedef struct particle_system particle_system;
5 typedef struct particle particle;
6 typedef struct particle_vert particle_vert;
7
8 struct particle_system {
9 struct particle {
10 v3f co, v;
11 f32 life;
12 u32 colour;
13 }
14 *array;
15
16 #pragma pack(push,1)
17 struct particle_vert {
18 v3f co;
19 u32 colour;
20 }
21 *vertices;
22 #pragma pack(pop)
23
24 u32 alive, max;
25 GLuint vao, vbo, ebo;
26
27 /* render settings */
28 f32 scale, velocity_scale, width;
29 }
30 extern particles_grind, particles_env;
31
32 void particle_alloc( particle_system *sys, u32 max );
33 void particle_system_update( particle_system *sys, f32 dt );
34 void particle_system_debug( particle_system *sys );
35 void particle_system_prerender( particle_system *sys );
36 void particle_system_render( particle_system *sys, vg_camera *cam );
37
38 void particle_spawn( particle_system *sys,
39 v3f co, v3f v, f32 lifetime, u32 colour );
40 void particle_spawn_cone( particle_system *sys,
41 v3f co, v3f dir, f32 angle, f32 speed,
42 f32 lifetime, u32 colour );