Fix draworder

This commit is contained in:
2023-08-06 21:17:43 +02:00
parent da1782c4a9
commit f3c0cc5965

View File

@@ -60,6 +60,11 @@ namespace openVulkanoCpp
if (drawable->GetScene() != this) drawable->SetScene(this);
if (Utils::Contains(shapeList, drawable)) return; // Prevent duplicate entries
shapeList.push_back(drawable);
if (shapeList.size() > 1 && shapeList[shapeList.size() - 2]->GetDrawPhase() < drawable->GetDrawPhase())
{
std::sort(shapeList.begin(), shapeList.end(),
[](Drawable* a, Drawable* b) { return a->GetDrawPhase() > b->GetDrawPhase(); });
}
}
void RemoveDrawable(Drawable* drawable)