summaryrefslogtreecommitdiff
path: root/ui/gameMainWindow.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-01 19:12:04 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-01 19:12:04 +0000
commit3b791f79bf53e481d053ea4516eedce8be3423bf (patch)
tree39817b0996eaa867c7f7abbc5dbd5cb706ecbaa5 /ui/gameMainWindow.cpp
parentSomewhat dirty but functional helper to save a texture (diff)
downloadilt-3b791f79bf53e481d053ea4516eedce8be3423bf.tar.bz2
ilt-3b791f79bf53e481d053ea4516eedce8be3423bf.tar.xz
ilt-3b791f79bf53e481d053ea4516eedce8be3423bf.zip
Switch to a deferred lighting based render pipeline
Tidy-up required.
Diffstat (limited to 'ui/gameMainWindow.cpp')
-rw-r--r--ui/gameMainWindow.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index 84d0ca6..c08588d 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -30,7 +30,8 @@ public:
};
GameMainWindow::GameMainWindow(size_t w, size_t h) :
- Window {w, h, "I Like Trains"}, camera {{-1250.0F, -1250.0F, 35.0F}, quarter_pi, rdiv(w, h), 0.1F, 10000.0F}
+ Window {w, h, "I Like Trains"}, SceneRenderer {size}, camera {{-1250.0F, -1250.0F, 35.0F}, quarter_pi, rdiv(w, h),
+ 0.1F, 10000.0F}
{
uiComponents.create<ManualCameraController>(glm::vec2 {-1150, -1150});
auto gms = uiComponents.create<GameMainSelector>(&camera, glm::vec2 {w, h});
@@ -51,8 +52,10 @@ GameMainWindow::tick(TickDuration)
void
GameMainWindow::render() const
{
- glEnable(GL_DEPTH_TEST);
- gameState->world.apply<Renderable>(&Renderable::render, shader);
+ SceneRenderer::render([this] {
+ gameState->world.apply<Renderable>(&Renderable::render, shader);
+ uiComponents.apply<WorldOverlay>(&WorldOverlay::render, shader);
+ });
Window::render();
}