From d781d5a3c1ec6872361db2a15786dfc0db9780f3 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Tue, 5 Oct 2021 06:35:09 -0400 Subject: Working tree render, now just have to do the leaves --- themes/LeafParticleRender.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 themes/LeafParticleRender.h (limited to 'themes/LeafParticleRender.h') 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 -- cgit v1.2.1