The new Magnum milestone brings WebGL 2.0 and WebAssembly, VR
support, lots of niceties for Windows users, iOS port, new experimental UI
library, improved testing capabilities, support for over 80 new asset
formats, new examples and much more.
After reading the “How to draw a red square in Qt Quick” blog post
showcasing the simplicity of Qt API I thought it would be interesting to
try something similar in Magnum for comparison.
Large C++ projects often suffer with very long times for both full
and incremental compilation, severely hurting productivity. The following
series will overview some techniques employed in Magnum to make iteration
times smaller, this article focuses on code-based optimizations.
Thanks to generic programming and other features exclusive to C++ it
is possible to handle polymorphism the most effective way for each use
case. As a result, virtual calls are in Magnum used very sparingly.
Regardless to what language you use, you always need to think about
memory management. Garbage collectors might give you a sense that it’s done
automagically, but to get more performance you need to have control over
heap usage in code running at 60 FPS. C++11 helps to avoid many heap
allocations without sacrificing usability.
Originally developed for Kompas, this library provides both static
and dynamic plugin management with dependency support and also various
filesystem, portability and debugging utilities.