What is the difference between #define NAME VALUE
and const int NAME = VALUE
in GLSL 410 core
?
As far as I can see, they both create a constant integer.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityWhat is the difference between #define NAME VALUE
and const int NAME = VALUE
in GLSL 410 core
?
As far as I can see, they both create a constant integer.
#define NAME VALUE
is a macro, where all instances of NAME
are replaced with VALUE
by the pre-processor.
The compiler handles constants. This ensures type safety.