Coding guidelines - martijnkoopman/SpatiumGL GitHub Wiki

Data types

  • All container classes must be templated. (Container classes: Matrix, Vector, Image)
  • All algorithm classes should work with doubles, not floats.
  • All data mapped to graphics memory should be floats (32-bit) to save memory, not doubles.

C++11

Utilize features of C++11 over C++0x if practical.

Rule of 5

If you write for a class one of a destructor, copy/move constructor, or copy/move assignment operator, then you must write all of them.

Arrays

Always use std::array over C-style arrays. They have practically no overhead.