Gnollrunner said:
I personally dislike namespaces. This is mainly because more than once I have seen people name stuff things like “Camera” in a their own namespace and then use some 3rd party library with it's own “Camera” and there is still a conflict.
But that's what's solved by this:
a light breeze said:
Put your entire engine into the same namespace.
Though, seems everybody is using just 2 letters for engine namespaces, so… : )
Personally i like it a lot. I use namespaces hierarchically, e.g. MeshProcessing::VectorFieldDesign::GenerateCurvatureField(). It's some typing, but i can see dependencies without looking for includes, and i can find functionality easy from Intellisense while typing.
Also VectorFieldDesign is just some functionality and has no member data or need for private functions, so no need for a class, and using a namespace still allows to group this stuff together then.
It's also especially useful when working with multiple math libs, or replacing one by another. I would not recommend to have only one common namespace. Vector and Matrix stuff is the most annoying issue for programming in general for me. Use 3 or 4 floats for a vec3? Use 4x4 or 3x4 for a transform? Need mat4x4 still anyways? To SIMD or not to SIMD? Template for float and double?
After decades i still can't answer any of those questions in general, and it remains probable replacement all the time.
SuperVGA said:
mind me asking why are you getting rid of GLM?
One argument may be performance: https://www.gamedev.net/forums/topic/709305-glm-vs-vs2019-for-simd/