cginternals / globjects

C++ library strictly wrapping OpenGL objects.
https://globjects.org
MIT License
539 stars 59 forks source link

Add forward declaration header #270

Closed mrzzzrm closed 9 years ago

mrzzzrm commented 9 years ago

Fixes #265

...in case you approve of something like this. Don't feel forced to accept this PR. I'd find it very useful, as described in the issue.

scheibel commented 9 years ago

This headers only helps when writing header files (and thus, during arcitectural development) and not during real feature development in the source code files.

glm provides such a header so that the user doesn't have to recognize if the types are structs/classes and in which namespace they are and to cope with the varying template parameters. I think all of that is not directly applicable for globjects usage. Despite this, we don't use the glm forward declaration headers in our projects and I think we discourage the use for a better clarity of code. I'm not sure whether glbinding have something like a forward declaration header that we use (types.h).

mrzzzrm commented 9 years ago

Granted, glm may have different motivations here than I do. I think uncluttered headers are worth quite something and I dislike having repetitive forward declarations of a 3rd party library in all my headers. (Especially if you put curly braces in separate own lines you end up with 4 lines of forward declaration if you just want to forward-declare a single globjects class) Would be nice to offer this "service" to library users, imo.

But as said, it's up to you.

scheibel commented 9 years ago

@sbusch42, @cgcostume: any opinions?

cgcostume commented 9 years ago

:+1: @scheibel - concerning glbinding, it uses some headers that aggregated multiple definitions, but only for the generated api, for all its additional classes, no forward decl header is intended - the same applies for globjects and libzeug - no forward declaration headers. Instead perhaps prefer to create your own forward decl header that you can use in your projects.