github recp/cglm v0.7.3
v0.7.3: Print Functions Update

latest releases: v0.9.4, v0.9.3, v0.9.2...
4 years ago

Bugfixes and Improvements:

  • suppress documentation warnings
  • remove redundant typedef
  • fix print functions to align column correctly

New Features:

Print Functions Improvements

  • While printing, mis-alignment of columns are fixed: larger numbers are printed via %g and others are printed via %f Column withs are calculated before print.

  • Now values are colorful ;)

    Screen Shot 2020-05-01 at 1 17 48 AM
  • New options with default values:

    #define CGLM_PRINT_PRECISION    5
    #define CGLM_PRINT_MAX_TO_SHORT 1e5
    #define CGLM_PRINT_COLOR        "\033[36m"
    #define CGLM_PRINT_COLOR_RESET  "\033[0m"
  • Inline prints are only enabled in DEBUG mode and if CGLM_DEFINE_PRINTS is defined.
  • You can still call library-print functions e.g. glmc_print...

To make codes unbroken, cglm makes inline print functions to be empty-body (if DEBUG and CGLM_DEFINE_PRINTS are not defined):

CGLM_INLINE void glm_mat4_print(mat4 matrix, FILE *o) { }

compiler must eliminate this empty inline function calls. This also can be disabled by defining CGLM_NO_PRINTS_NOOP macro. 🎉

Define CGLM_PRINT_PRECISION to change print precision, default is increased to 5 from 4 ...

Don't miss a new cglm release

NewReleases is sending notifications on new releases.