From 145a89666cf3536076fd9caca3598c1cc5034c2f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 16 Aug 2022 07:33:21 -0400 Subject: [PATCH] Add error messages for obj loading --- include/scene.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/scene.h b/include/scene.h index d9be5fe..8b458c9 100644 --- a/include/scene.h +++ b/include/scene.h @@ -81,8 +81,10 @@ struct Scene { Object& load_from_file(const std::string_view path) { auto o = std::make_unique(); - - 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)); }