Fix issues with ui rendering
This commit is contained in:
@@ -106,7 +106,7 @@ namespace openVulkanoCpp::Scene
|
||||
{
|
||||
CheckShaderInitState();
|
||||
if (bindingId < 0) bindingId = static_cast<int>(vertexInputDescriptions.size());
|
||||
while (bindingId > vertexInputDescriptions.size())
|
||||
while (bindingId > static_cast<int>(vertexInputDescriptions.size()))
|
||||
{
|
||||
vertexInputDescriptions.emplace_back(0, 0);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ namespace openVulkanoCpp::Scene
|
||||
if (setId < 0) setId = static_cast<int>(descriptorSets.size() + 2);
|
||||
if (setId < 2) throw std::runtime_error("Cant bind set id 0 or 1!");
|
||||
setId -= 2;
|
||||
while (setId >= descriptorSets.size())
|
||||
while (setId >= static_cast<int>(descriptorSets.size()))
|
||||
{
|
||||
descriptorSets.emplace_back();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user