Only create a Mesh if anything was actually drawn
This commit is contained in:
parent
640c86d0c7
commit
88595c7777
1 changed files with 8 additions and 0 deletions
|
|
@ -67,10 +67,18 @@ void MeshBuilder::Apply()
|
|||
|
||||
std::unique_ptr<Mesh> MeshBuilder::Create()
|
||||
{
|
||||
if (mDraws.Size() == 0)
|
||||
return {};
|
||||
|
||||
auto mesh = std::make_unique<Mesh>();
|
||||
mesh->mApplys = std::move(mApplys);
|
||||
mesh->mDraws = std::move(mDraws);
|
||||
mesh->mVertices = std::move(mVertices);
|
||||
|
||||
mApplys.Clear();
|
||||
mDraws.Clear();
|
||||
mVertices.Clear();
|
||||
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue