Mesa (mesa_7_5_branch): glapi: ensure _mesa_lookup_prim_by_nr() is not clobbered on regeneration

Keith Whitwell keithw at kemper.freedesktop.org
Thu Jul 2 12:33:32 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 798cd2a98d66a1b841930e121676ae1a8f9fb244
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=798cd2a98d66a1b841930e121676ae1a8f9fb244

Author: Keith Whitwell <keithw at vmware.com>
Date:   Thu Jul  2 13:28:20 2009 +0100

glapi: ensure _mesa_lookup_prim_by_nr() is not clobbered on regeneration

Propogate changes to enums.c back up to the python source.

---

 src/mesa/glapi/gl_enums.py |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py
index b32e012..27ab119 100644
--- a/src/mesa/glapi/gl_enums.py
+++ b/src/mesa/glapi/gl_enums.py
@@ -110,6 +110,29 @@ const char *_mesa_lookup_enum_by_nr( int nr )
    }
 }
 
+/* Get the name of an enum given that it is a primitive type.  Avoids
+ * GL_FALSE/GL_POINTS ambiguity and others.
+ */
+const char *_mesa_lookup_prim_by_nr( int nr )
+{
+   switch (nr) {
+   case GL_POINTS: return "GL_POINTS";
+   case GL_LINES: return "GL_LINES";
+   case GL_LINE_STRIP: return "GL_LINE_STRIP";
+   case GL_LINE_LOOP: return "GL_LINE_LOOP";
+   case GL_TRIANGLES: return "GL_TRIANGLES";
+   case GL_TRIANGLE_STRIP: return "GL_TRIANGLE_STRIP";
+   case GL_TRIANGLE_FAN: return "GL_TRIANGLE_FAN";
+   case GL_QUADS: return "GL_QUADS";
+   case GL_QUAD_STRIP: return "GL_QUAD_STRIP";
+   case GL_POLYGON: return "GL_POLYGON";
+   case GL_POLYGON+1: return "OUTSIDE_BEGIN_END";
+   default: return "<invalid>";
+   }
+}
+
+
+
 int _mesa_lookup_enum_by_name( const char *symbol )
 {
    enum_elt * f = NULL;




More information about the mesa-commit mailing list