diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-16 18:43:26 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-16 18:43:26 +0000 |
| commit | bcea70c226070b44cca2c20ff7d4cf29d5b018fd (patch) | |
| tree | 9fc4e8ed91d4e86aad81d92633127324e58210b2 /ui | |
| parent | Support for testing if a point/sphere is within a Frustum (diff) | |
| download | ilt-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.cpp | 6 |
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); |
