1
Fork 0

Add error messages for obj loading

This commit is contained in:
Joshua Goins 2022-08-16 07:33:21 -04:00
parent c707efbd8c
commit 145a89666c

View file

@ -82,7 +82,9 @@ struct Scene {
Object& load_from_file(const std::string_view path) {
auto o = std::make_unique<Object>();
tinyobj::LoadObj(&o->attrib, &o->shapes, &o->materials, nullptr, path.data());
std::string err;
if(!tinyobj::LoadObj(&o->attrib, &o->shapes, &o->materials, &err, path.data()))
std::cerr << "Could not load obj: " << err;
return *objects.emplace_back(std::move(o));
}