Nazaj na multithreadanje - fonti

This commit is contained in:
2026-03-12 16:18:51 +01:00
parent 834f0b29c3
commit 74159a6fda
20 changed files with 254 additions and 43 deletions

View File

@@ -39,12 +39,14 @@ namespace Game::Renderer {
void Renderer::renderFrame() {
mClear();
// Get gamestate and render the objects here; GameState::getState().objects or something, idk
auto entities = Game::State::GameState::getInstance().getEntitiesRef();
//LOG("Entity count: " << entities->size());
for (auto& entity : *entities) {
entity->render(this);
try {
Game::State::GameState::getInstance().withEntitiesLocked([this](auto& entities) {
for (auto& entity : entities) {
entity->render(this);
}
});
} catch (const std::exception& e) {
ERROR("Exception while rendering frame: " << e.what());
}
mPresent();