diff options
author | Matthew Kosarek <mattkae@protonmail.com> | 2021-10-05 06:35:09 -0400 |
---|---|---|
committer | Matthew Kosarek <mattkae@protonmail.com> | 2021-10-05 06:35:09 -0400 |
commit | d781d5a3c1ec6872361db2a15786dfc0db9780f3 (patch) | |
tree | 7e355a89bb0062cdd7692f3dae820a5e467aba9e /themes/LeafParticleRender.h | |
parent | 9d33d175b5cd564e77bda07fcbce252477f7c40f (diff) |
Working tree render, now just have to do the leaves
Diffstat (limited to 'themes/LeafParticleRender.h')
-rw-r--r-- | themes/LeafParticleRender.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/themes/LeafParticleRender.h b/themes/LeafParticleRender.h new file mode 100644 index 0000000..5953000 --- /dev/null +++ b/themes/LeafParticleRender.h @@ -0,0 +1,35 @@ +#include "Renderer2d.h" +#include "mathlib.h" +#include "types.h" + +struct TreeShape; + +struct LeafParticleLoadData { + Vector2 initPosition; + Vector4 initColor; + int numLeaves = 48; +}; + +struct LeafParticleUpdateData { + bool canFall = false; + Vector4 color = Vector4(1.f, 0.f, 0.f, 0.f); + float32 scale = 1.f; + Vector2 fallDirection; +}; + +struct LeafParticleRender { + // Update data + int32 numLeaves = 0; + Renderer2dVertex* vertices = NULL; + + // Render data + uint32 vao; + uint32 vbo; + uint32 numVertices = 0; + Mat4x4 model; + + void load(Renderer2d* renderer, TreeShape* tree); + void update(float32 dtSeconds); + void render(Renderer2d* renderer); + void unload(); +};
\ No newline at end of file |