Closed Ybalrid closed 7 years ago
Having a bunch of std::function declared in a header cause link problems. And looking at it, it's a silly way to do it.
The fixMacros branch has a more sane solution by declaring a bunch of function globally (in the Annwyvn namespace) and implementing them like in C.
Every AnnGetXXX() "function" in code is actually a macro that will be evaluated to "AnnEngine::Instance()-getXXX()". This makes some part of the code a bit hard to debug and it a bit ugly.
To be fair, it's not a huge deal and huge stuff like OpenGL are working exactly like this on most implementations. Theses functions exist for the sake of simplifying the code while keeping things somewhat encapsulated and organized under the hood.
Re-writing theses as a bunch of function in this style could do the trick :
Would be nicer. It may also permit a simpler integration of these getters into the ChaiScript bindings