[Mesa-dev] [PATCH 2/2] Document the return type coding style.
Ian Romanick
idr at freedesktop.org
Wed Aug 24 12:22:43 PDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/23/2011 01:48 AM, Kai Wasserbäch wrote:
>
> 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 | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
If you use git-send-email, I could have replied with comments in-line. :)
We still use GL types like GLint in various places in Mesa. It's only
GLboolean that we've decided not to use. I think I'd say:
<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 <stdbool.h></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>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk5VT4MACgkQX1gOwKyEAw9S1QCeJAVXyO+ETuYv27OhWVu4GvfB
sQsAoKCLhkFO5eMIVop/emjtSax/If+p
=eFhW
-----END PGP SIGNATURE-----
More information about the mesa-dev
mailing list