Heya,
id like to have some input on a choice i have to make when writing a c++ wrapper.
Reasoning for writing (yet antoher?) one this is quite short:
I don’t want exception based error handling, and its good training for myself.
Anyway, my question:
Should it become header based, or a linked library?
Linked lib has the shorter compile time on projects (as its just linked).
It would however add another layer of call abstraction around basically everything (call to abstraction function -> call to sdl function). Also it is a tad less dynamic in user-configuration ability.
Header based would mean that during the build, everything has to be evaluated.
It would allow for some nice abstractions and templatifications however (example: stuff could be wrapped inside user-chosen smart pointers instead of unique_ptr and shared_ptr).
Also there is a bigger chance of inlining, though im quite sure alot of stuff will still add call-abstraction or similar.
In the end both of those are quite likely not without runtime cost i suppose. I could work with both, so it would be nice to hear the opinions of others.
Thanks
~mkalte
PS: I dont want to imply that SDL is unusable in c++ or something. I use it in more or less every project i create for fun or work. However, i always end up with wrappers around stuff like SDL_Texture - and thus im here now^^