summaryrefslogtreecommitdiff
path: root/game/environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/environment.cpp')
-rw-r--r--game/environment.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/game/environment.cpp b/game/environment.cpp
new file mode 100644
index 0000000..fd2bfd4
--- /dev/null
+++ b/game/environment.cpp
@@ -0,0 +1,18 @@
+#include "environment.h"
+#include <chronology.h>
+#include <gfx/gl/sceneRenderer.h>
+
+Environment::Environment() : worldTime {"2024-01-01T12:00:00"_time_t} { }
+
+void
+Environment::tick(TickDuration)
+{
+ worldTime += 1;
+}
+
+void
+Environment::render(const SceneRenderer & renderer, const SceneProvider & scene) const
+{
+ renderer.setAmbientLight({0.5F, 0.5F, 0.5F});
+ renderer.setDirectionalLight({0.6F, 0.6F, 0.6F}, {-1, 1, -1}, scene);
+}