Change API and handle no-mtl-file case correctly. Fixes #58.

This commit is contained in:
Syoyo Fujita
2015-11-07 23:08:39 +09:00
parent 475bc83ef3
commit e7e7eed616
7 changed files with 500 additions and 50 deletions

View File

@@ -86,9 +86,12 @@ main(
for (int i = 0; i < num_objfiles; i++) {
std::cout << "Loading " << argv[i+1] << " ... " << std::flush;
std::string err = tinyobj::LoadObj(shapes[i], materials[i], argv[i+1]);
std::string err;
bool ret = tinyobj::LoadObj(shapes[i], materials[i], err, argv[i+1]);
if (!err.empty()) {
std::cerr << err << std::endl;
}
if (!ret) {
exit(1);
}