syoyo/tinyobjloader — pull request #12 by burnse (2014-04-28 22:08:40+00:00)
Title: Added a LoadObj function that reads from a std::istream.

The intention of these changes is to provide the ability to read obj files from a std::istream, or anything extending it. This should be useful if you want to do something like reading objs from an archive or have generated data and can pass it as a stream.

- The added version of LoadObj is similar to the existing one, but takes a std::function that is used within the LoadObj function to return a pointer to a std::istream for the specified material when 'mtllib' is parsed.
- LoadMtl was also modified to accept a std::istream.

- Modified test.cc to load an object and material from a stringstream just as a very simple example.

- The original LoadObj function still exists, so this change should not break any existing code.

- Some C++11 features were used (function, auto, lambdas, unique_ptr), checked compilation of test.cc works using VS2012 (win), clang++ 3.4 (Ubuntu) and g++ 4.8.2 (Ubuntu). Output looked fine.

Any problems or changes required?

Thanks for this nice library!