summaryrefslogtreecommitdiff
path: root/lighting.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-02-09 18:50:58 +1100
committerquou <quou@disroot.org>2025-02-09 18:51:30 +1100
commit629dc808c595d65cda74a86975ebd780113f3431 (patch)
tree72d0c17600c6420fc2b834529d781dc43cc20317 /lighting.hpp
parent1c86bb51da99df1950124d812eabcfe15af4f771 (diff)
Properly send lights from the CPU
Diffstat (limited to 'lighting.hpp')
-rw-r--r--lighting.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/lighting.hpp b/lighting.hpp
new file mode 100644
index 0000000..f7708a1
--- /dev/null
+++ b/lighting.hpp
@@ -0,0 +1,29 @@
+#ifndef lighting_hpp
+#define lighting_hpp
+
+#include "maths.hpp"
+#include "video.hpp"
+
+struct Arena;
+struct World;
+
+struct Lighting {
+ static constexpr int max_lights = 128;
+ Staged_Buffer lights;
+ int light_count;
+ void init(Device* dev);
+ void destroy(Device* dev);
+ void update(Device* dev, Context& ctx, World& w);
+ void write_buf(void* ptr, World& w);
+};
+
+struct Light {
+ v3f colour;
+ float brightness;
+};
+
+struct Sun_Light : Light {
+ v3f dir;
+};
+
+#endif