Hacker News new | ask | show | jobs
by peaton 4231 days ago
Taking a course on OpenGL Graphics programming in university right now. We use GLM. It seems pretty good. If I'm not mistaken this is a (potential) replacement for GLM? If anyone knows GLM well could they discuss the differences between the two libraries? Is this worth investing time into?
2 comments

GLM is extremely full featured compared to this. It's also very stable and portable. From GLM home page:

-------------

This library provides classes and functions designed and implemented following as strictly as possible the GLSL conventions and functionalities so that when a programmer knows GLSL, he knows GLM as well, making it really easy to use.

This project isn't limited to GLSL features. An extension system provides extended capabilities: matrix transformations, quaternions, half-based types, random number generation, procedural noise functions, etc.

GLM ensures interoperability with third party libraries, SDKs and OpenGL; replacing advantageously the deprecated matrix functions. It is a good candidate for software rendering (Raytracing / Rasterisation), image processing, physic simulations and any context that requires a simple and convenient mathematics library.

It is a platform independent library with no dependence to external libraries even OpenGL. GLM is written in C++98 but can take advantage of C++11 when available.

Only downside I found with GLM is it is dog slow when built without optimisations, making debugging painful, and as it is a header only library you can't compile an optimised version for debugging purposes. I'm not aware of any libraries that solve this problem though, while still remaining as fast when fully optimised. I did consider trying to create a custom recompiled header built with full optimisations but I never got around to investigating it as an option...
Try this [1]:

    #pragma GCC push_options
    #pragma GCC optimize("O2")
    #include <something>
    #pragma GCC pop_options
[1] https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-...
I'm working with Visual Studio :) But this would have been awesome, as I think it compiled with MinGW.