If

The #if macro is used to conditionally execute a block of GLM code only if the test succeeds.

Each #if macro must have a correspond #endif macro matching it in the same GLM file.

GLM
// conditional block
 * 1) if test
 * 1) endif

Tests are based on comparisons between values, such as comparing a variable to a number:


 * 1) if ${threadcount}>1
 * 2) print Running multithreaded mode
 * 3) endif

Version

 * Prior to

The first term of the test was expanded as though it was a variable, e.g.,


 * 1) if VAR==1

was the same as


 * 1) if ${VAR}==1


 * As of

The expansion of the first term is deprecated and use of that syntax will cause a warning message to that effect.