Mesa (master): Document the return type coding style.

Ian Romanick idr at
Thu Aug 25 07:22:01 PDT 2011

Module: Mesa
Branch: master
Commit: dbec3a5daf6fd012adc4d9690ef1dccc65969e04

Author: Kai Wasserbäch <kai at>
Date:   Tue Aug 23 10:48:58 2011 +0200

Document the return type coding style.

As per discussion at [0] methods shouldn't use OpenGL return types, if
they're not part of the GL API.

[0] <>

Signed-off-by: Kai Wasserbäch <kai at>
Signed-off-by: Ian Romanick <ian.d.romanick at>


 docs/devinfo.html |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/docs/devinfo.html b/docs/devinfo.html
index c096648..d9e82e2 100644
--- a/docs/devinfo.html
+++ b/docs/devinfo.html
@@ -137,6 +137,16 @@ Function name examples:
 	_mesa_foo_bar()  - an internal non-static Mesa function
+Places that are not directly visible to the GL API should prefer the use
+of <tt>bool</tt>, <tt>true</tt>, and
+<tt>false</tt> over <tt>GLboolean</tt>, <tt>GL_TRUE</tt>, and
+<tt>GL_FALSE</tt>.  In C code, this may mean that
+<tt>#include &lt;stdbool.h&gt;</tt> need to be added.  The
+<tt>try_emit_</tt>* methods in src/mesa/program/ir_to_mesa.cpp and
+src/mesa/state_tracker/st_glsl_to_tgsi.cpp can serve as an example.
 <H2>Making a New Mesa Release</H2>

More information about the mesa-commit mailing list