]> git.cworth.org Git - apitrace/commitdiff
Dump glClear and glBegin arguments correctly.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 4 May 2009 09:20:52 +0000 (10:20 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 4 May 2009 09:20:52 +0000 (10:20 +0100)
base.py
gl.py
opengl32.py

diff --git a/base.py b/base.py
index 2678ab87614b05221689420e038490d53a67df40..5cf8c77db29548c6b3e61463f3c2fd59b784d488 100644 (file)
--- a/base.py
+++ b/base.py
@@ -176,6 +176,19 @@ class Enum(Concrete):
         print '    }'
 
 
+class FakeEnum(Enum):
+
+    __seq = 0
+    
+    def __init__(self, type, values):
+        FakeEnum.__seq += 1
+        Enum.__init__(self, type.name + str(FakeEnum.__seq), values)
+        self.type = type
+    
+    def __str__(self):
+        return str(self.type)
+
+
 class Flags(Concrete):
 
     __seq = 0
diff --git a/gl.py b/gl.py
index 5f2f8d88dee5df6189bea3eb1505be5a8fe9d1e2..1acfce189a69d53fa5b99b21165ece612bff61f4 100644 (file)
--- a/gl.py
+++ b/gl.py
@@ -804,7 +804,7 @@ GLenum = Enum("GLenum", [
 #    "GL_MAX_TEXTURE_UNITS_ARB", # 0x84E2
 ])
 
-[
+GLprimenum = FakeEnum(GLenum, [
     "GL_POINTS", # 0x0000
     "GL_LINES", # 0x0001
     "GL_LINE_LOOP", # 0x0002
@@ -815,7 +815,14 @@ GLenum = Enum("GLenum", [
     "GL_QUADS", # 0x0007
     "GL_QUAD_STRIP", # 0x0008
     "GL_POLYGON", # 0x0009
-]
+])
+
+GLbufferbitfield = Flags(GLbitfield, [
+    "GL_DEPTH_BUFFER_BIT", # 0x00000100
+    "GL_ACCUM_BUFFER_BIT", # 0x00000200
+    "GL_STENCIL_BUFFER_BIT", # 0x00000400
+    "GL_COLOR_BUFFER_BIT", # 0x00004000
+])
 
 [
     "GL_ALL_ATTRIB_BITS", # 0x000FFFFF
@@ -827,13 +834,9 @@ GLenum = Enum("GLenum", [
     "GL_PIXEL_MODE_BIT", # 0x00000020
     "GL_LIGHTING_BIT", # 0x00000040
     "GL_FOG_BIT", # 0x00000080
-    "GL_DEPTH_BUFFER_BIT", # 0x00000100
-    "GL_ACCUM_BUFFER_BIT", # 0x00000200
-    "GL_STENCIL_BUFFER_BIT", # 0x00000400
     "GL_VIEWPORT_BIT", # 0x00000800
     "GL_TRANSFORM_BIT", # 0x00001000
     "GL_ENABLE_BIT", # 0x00002000
-    "GL_COLOR_BUFFER_BIT", # 0x00004000
     "GL_HINT_BIT", # 0x00008000
     "GL_EVAL_BIT", # 0x00010000
     "GL_LIST_BIT", # 0x00020000
index 0fe92254aad8a92f02278d8fff6c84541cdf3bad..992517ac89db94392f05bfcbc2cdfbce4ce09386 100644 (file)
@@ -29,7 +29,7 @@ opengl32.functions += [
     Function(Void, "glDeleteLists", [(GLuint, "list"), (GLsizei, "range")]),
     Function(GLuint, "glGenLists", [(GLsizei, "range")]),
     Function(Void, "glListBase", [(GLuint, "base")]),
-    Function(Void, "glBegin", [(GLenum, "mode")]),
+    Function(Void, "glBegin", [(GLprimenum, "mode")]),
     Function(Void, "glBitmap", [(GLsizei, "width"), (GLsizei, "height"), (GLfloat, "xorig"), (GLfloat, "yorig"), (GLfloat, "xmove"), (GLfloat, "ymove"), (Pointer(Const(GLubyte)), "bitmap")]),
     Function(Void, "glColor3b", [(GLbyte, "red"), (GLbyte, "green"), (GLbyte, "blue")]),
     Function(Void, "glColor3bv", [(Pointer(Const(GLbyte)), "v")]),
@@ -225,7 +225,7 @@ opengl32.functions += [
     Function(Void, "glPopName", []),
     Function(Void, "glPushName", [(GLuint, "name")]),
     Function(Void, "glDrawBuffer", [(GLenum, "mode")]),
-    Function(Void, "glClear", [(GLbitfield, "mask")]),
+    Function(Void, "glClear", [(GLbufferbitfield, "mask")]),
     Function(Void, "glClearAccum", [(GLfloat, "red"), (GLfloat, "green"), (GLfloat, "blue"), (GLfloat, "alpha")]),
     Function(Void, "glClearIndex", [(GLfloat, "c")]),
     Function(Void, "glClearColor", [(GLclampf, "red"), (GLclampf, "green"), (GLclampf, "blue"), (GLclampf, "alpha")]),