diff options
author | Jakob Bornecrantz <[email protected]> | 2009-07-03 18:53:58 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2009-07-03 18:53:58 +0200 |
commit | 862488075c5537b0613753b0d14c267527fc6199 (patch) | |
tree | fd4d51272c86fbc88c12e2d16649547f3ca7b8df /src/mesa/glapi/gl_enums.py | |
parent | 060c7f2321f72503c14f9f3f7bb27d59d8a90224 (diff) | |
parent | 94e1117c9ba259665cd8e790369dcd4c789a2f93 (diff) |
Merge branch 'mesa_7_5_branch'
Conflicts:
src/mesa/main/dlist.c
src/mesa/vbo/vbo_save_api.c
Diffstat (limited to 'src/mesa/glapi/gl_enums.py')
-rw-r--r-- | 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 b32e0126631..27ab119537e 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; |