New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use templated type for real_t #233
Comments
I thought about this when I added the double support, but did not want to break the API. I think a template solution only makes sense, if:
The current API could be kept, e.g. by using the following pattern: template<typename T>
struct attrib_generic_t
{
std::vector<T> vertices;
...
}
using attrib_float_t = attrib_generic_t<float>;
using attrib_double_t = attrib_generic_t<double>;
using attrib_t = attrib_float_t; // default to float for the old typename I think this would not break the API, but I am still not sure what the advantage for users would be. Other than that we could get rid of the |
Thanks!
Yes, I thought similar solution
I'm thinking about this. I think there is almost no demand to support real type other than
|
Currently we use ifdef(`TINYOBJLOADER_USE_DOUBLE) to swtich real type
https://github.com/syoyo/tinyobjloader/blob/master/tiny_obj_loader.h#L130
It is better to use templated type for real type, for example:
This may beak existing API, so we may need to introduce new API for it.
The text was updated successfully, but these errors were encountered: