aboutsummaryrefslogtreecommitdiff
path: root/src/obj_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/obj_parser.cpp')
-rw-r--r--src/obj_parser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/obj_parser.cpp b/src/obj_parser.cpp
index 196261e..b30eff1 100644
--- a/src/obj_parser.cpp
+++ b/src/obj_parser.cpp
@@ -92,6 +92,10 @@ float parse_int(const std::string& s) {
o3d::Mesh parse_object(const std::string& obj_path) {
o3d::Mesh mesh;
std::ifstream obj_file(obj_path);
+ if (!obj_file.is_open()) {
+ std::cerr << "file `" << obj_path << "'not found" << std::endl; // TODO: improve
+ std::exit(1);
+ }
std::string line;
while (std::getline(obj_file, line)) {
if (line.length() == 0 || line[0] == '#')