From bcea70c226070b44cca2c20ff7d4cf29d5b018fd Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 16 Feb 2026 18:43:26 +0000 Subject: 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. --- ui/gameMainWindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui') 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->preFrame(camera); + } + } + gameState->world.apply(&Renderable::preFrame, camera); SceneRenderer::render(*this); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -- cgit v1.3