Add support of group tag('g')

This commit is contained in:
Syoyo Fujita
2013-04-25 17:01:52 +09:00
parent 07a52129a5
commit 6556411006
4 changed files with 102 additions and 12 deletions

33
test.cc
View File

@@ -5,22 +5,17 @@
#include <cassert>
#include <iostream>
int
main(
int argc,
char **argv)
static bool
TestLoadObj(const char* filename)
{
std::string inputfile = "cornell_box.obj";
std::vector<tinyobj::shape_t> shapes;
std::cout << "Loading " << filename << std::endl;
if (argc > 1) {
inputfile = std::string(argv[1]);
}
std::string err = tinyobj::LoadObj(shapes, inputfile.c_str());
std::vector<tinyobj::shape_t> shapes;
std::string err = tinyobj::LoadObj(shapes, filename);
if (!err.empty()) {
std::cerr << err << std::endl;
return false;
}
std::cout << "# of shapes : " << shapes.size() << std::endl;
@@ -61,5 +56,21 @@ main(
printf("\n");
}
return true;
}
int
main(
int argc,
char **argv)
{
if (argc > 1) {
assert(true == TestLoadObj(argv[1]));
} else {
assert(true == TestLoadObj("cornell_box.obj"));
assert(true == TestLoadObj("cube.obj"));
}
return 0;
}