Fixed weird timing issues with std::future

This commit is contained in:
Antoine Pilote
2024-08-15 18:40:33 -04:00
parent 9d74c782ab
commit 711a9a9751

View File

@@ -189,10 +189,9 @@ namespace Nuake
m_IndicesCount = static_cast<uint32_t>(m_Indices.size());
std::vector<Vertex> vertices;
auto asyncResult = std::async(std::launch::async, [&]()
auto result = std::async(std::launch::async, [&]()
{
std::vector<Vertex> vertices;
for (auto& v : j["Vertices"])
{
Vertex vertex;
@@ -208,10 +207,12 @@ namespace Nuake
DESERIALIZE_VEC3(v["Bitangent"], vertex.bitangent)
vertices.push_back(vertex);
}
return vertices;
}
);
m_Vertices = vertices;
m_Vertices = result.get();
SetupMesh();
return true;