Fix issues with ui rendering

This commit is contained in:
2023-09-08 18:17:16 +02:00
parent 2bcea0d7fd
commit 703f5c0d12
12 changed files with 43 additions and 50 deletions

View File

@@ -27,7 +27,8 @@ namespace openVulkanoCpp::Scene::UI
Draw();
for(const auto& child : children)
{
child->Render();
if (child->ShouldDraw())
child->Render();
}
EndDraw();
}
@@ -38,6 +39,8 @@ namespace openVulkanoCpp::Scene::UI
virtual void Draw() = 0;
virtual void EndDraw() {};
virtual bool ShouldDraw() { return true; }
};
class Ui : public UiElement