summaryrefslogtreecommitdiff
path: root/themes/LeafParticleRender.h
diff options
context:
space:
mode:
Diffstat (limited to 'themes/LeafParticleRender.h')
-rw-r--r--themes/LeafParticleRender.h35
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