Those macros were created because C didn't have a true/false keyword like C++ does.
In C using
GL_FALSE made the code easier to read compared to using just 0 and 1 so it was provided by the OpenGL headers.
In C++ you may as well use the builtin keywords
false and enjoy your favorite IDE's highlighting feature. Or you may use OpenGL's macro to be consistent with OpenGL code.
GL_TRUE is 1 and
GL_FALSE is 0.
true is also 1 and
false is also 0.
It's guaranteed to work.
For portability however you must still use
GLboolean and not
bool for any GL functions demanding a pointer to
GLboolean (such as
glGetBooleanv) even if they happen to be the same size on current platforms. That may not be the case in the future.
GLboolean b = true; is perfectly safe.
To answer the comment on explicitly comparing to
It's generally a bad idea to compare to
if(x == true)) as this may introduce hard to find bugs (eg: where x is 2). You should use simply
if(x) as anything other than zero is considered true but may not be equal to
true and this may create an inconsistency between what your code thinks is true and OpenGL's interpretation.
GLboolean are not
bool and may (accidentally) contain a value other than 1 or 0. This can cause some confusion and the comparison failing can result in a red herring and many hours of debugging down the wrong path when tracing code.
false is safe (both
!=) as only 0 can be
So if you wish to use an explicit comparison use
if(x != GL_FALSE) to consistently compare x to "true".