Add error messages for obj loading
This commit is contained in:
parent
c707efbd8c
commit
145a89666c
1 changed files with 4 additions and 2 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue