summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-23 19:35:34 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-23 19:35:34 +0000
commit35546b223856688ae08a64b0cf4f07c47e465ee7 (patch)
tree7c9c4636522eea4b789c54a455a3aeb30b3f7dfb
parentAdd rendering support for point lights (diff)
downloadilt-35546b223856688ae08a64b0cf4f07c47e465ee7.tar.bz2
ilt-35546b223856688ae08a64b0cf4f07c47e465ee7.tar.xz
ilt-35546b223856688ae08a64b0cf4f07c47e465ee7.zip
Add light stage to renderable objects
-rw-r--r--gfx/renderable.cpp6
-rw-r--r--gfx/renderable.h1
-rw-r--r--ui/gameMainWindow.cpp3
3 files changed, 9 insertions, 1 deletions
diff --git a/gfx/renderable.cpp b/gfx/renderable.cpp
new file mode 100644
index 0000000..9e8d122
--- /dev/null
+++ b/gfx/renderable.cpp
@@ -0,0 +1,6 @@
+#include "renderable.h"
+
+void
+Renderable::lights(const SceneShader &) const
+{
+}
diff --git a/gfx/renderable.h b/gfx/renderable.h
index 9b25645..f75c36f 100644
--- a/gfx/renderable.h
+++ b/gfx/renderable.h
@@ -11,4 +11,5 @@ public:
DEFAULT_MOVE_COPY(Renderable);
virtual void render(const SceneShader & shader) const = 0;
+ virtual void lights(const SceneShader & shader) const;
};
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index 8e7e711..99bee48 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -61,6 +61,7 @@ GameMainWindow::environment(const SceneShader & s, const SceneRenderer & r) cons
SceneRenderer::SceneProvider::environment(s, r);
}
void
-GameMainWindow::lights(const SceneShader &) const
+GameMainWindow::lights(const SceneShader & shader) const
{
+ gameState->world.apply<Renderable>(&Renderable::lights, shader);
}