I am trying to load a bunch of mesh resources in the format of .obj files. Some of the files are very high in poly count so when loading using the below method It takes more than 10 seconds. I would really like to cut this time down.
My question is how can I bind this to call loadMesh with std::async? Because I think that might help speed up the process.
Mesh *Loader::loadMesh(const std::string &path)
{
std::shared_ptr<Mesh> mesh = Mesh::load(path);
m_meshes.push_back(mesh);
return m_meshes.back().get();
}
.
.
.
//this is the binding
luabind::module(m_world->getLua()->get())
[
luabind::class_<Loader>("world")
.def("load_mesh", &Loader::loadMesh)
]