Document the return type coding style.
authorKai Wasserbäch <kai@dev.carbon-project.org>
Tue, 23 Aug 2011 08:48:58 +0000 (10:48 +0200)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 25 Aug 2011 14:21:00 +0000 (07:21 -0700)
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>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
docs/devinfo.html

index c0966480ab7a2fe1f5b4e25aa60474b11c18cb63..d9e82e29d0ba426e6d15d281978ef316347cfd19 100644 (file)
@@ -137,6 +137,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>