[Mesa-dev] [PATCH 2/2] Document the return type coding style.

Kai Wasserbäch kai at dev.carbon-project.org
Wed Aug 24 13:11:33 PDT 2011


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

[0] <http://marc.info/?l=mesa3d-dev&m=130754488901774&w=2>

CC: Ian Romanick <idr at freedesktop.org>
Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
---
 docs/devinfo.html |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/docs/devinfo.html b/docs/devinfo.html
index 8887dd0..073e41e 100644
--- a/docs/devinfo.html
+++ b/docs/devinfo.html
@@ -114,6 +114,16 @@ Function name examples:
 	_mesa_foo_bar()  - an internal non-static Mesa function
 </pre>
 
+<p>
+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.
+</p>
+
 
 <H2>Making a New Mesa Release</H2>
 
-- 
1.7.5.4



More information about the mesa-dev mailing list