summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-02-16 18:43:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-02-16 18:43:26 +0000
commitbcea70c226070b44cca2c20ff7d4cf29d5b018fd (patch)
tree9fc4e8ed91d4e86aad81d92633127324e58210b2 /ui
parentSupport for testing if a point/sphere is within a Frustum (diff)
downloadilt-bcea70c226070b44cca2c20ff7d4cf29d5b018fd.tar.bz2
ilt-bcea70c226070b44cca2c20ff7d4cf29d5b018fd.tar.xz
ilt-bcea70c226070b44cca2c20ff7d4cf29d5b018fd.zip
Add Renderable::preFrame for doing non-const frame prep work
In theory, this phase should be parallelisable before being pushed out by the render loop.
Diffstat (limited to 'ui')
-rw-r--r--ui/gameMainWindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index dbbf8a7..eec5512 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -85,6 +85,12 @@ GameMainWindow::handleInput(const SDL_Event & event)
void
GameMainWindow::render()
{
+ for (const auto & [assetId, asset] : gameState->assets) {
+ if (const auto renderable = asset.getAs<Renderable>()) {
+ renderable->preFrame(camera);
+ }
+ }
+ gameState->world.apply<const Renderable>(&Renderable::preFrame, camera);
SceneRenderer::render(*this);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);