Add error messages for obj loading
This commit is contained in:
parent
c707efbd8c
commit
145a89666c
1 changed files with 4 additions and 2 deletions
|
@ -81,8 +81,10 @@ struct Scene {
|
||||||
|
|
||||||
Object& load_from_file(const std::string_view path) {
|
Object& load_from_file(const std::string_view path) {
|
||||||
auto o = std::make_unique<Object>();
|
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));
|
return *objects.emplace_back(std::move(o));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue