]> git.cworth.org Git - apitrace/blobdiff - specs/glxapi.py
d3dretrace: Fix MinGW build.
[apitrace] / specs / glxapi.py
index bde57d80ec7881dbaa7c9db29afe79fba710fb0e..ad2533c510a37da190d53a3345672a95c339d551 100644 (file)
@@ -48,6 +48,8 @@ GLXWindow = Alias("GLXWindow", UInt32)
 GLXPbuffer = Alias("GLXPbuffer", UInt32)
 GLXPbufferSGIX = Alias("GLXPbufferSGIX", UInt32)
 GLXVideoSourceSGIX = Alias("GLXVideoSourceSGIX", UInt32)
+GLXVideoDeviceNV = Alias("GLXVideoDeviceNV", UInt32)
+GLXVideoCaptureDeviceNV = Alias("GLXVideoCaptureDeviceNV", UInt32)
 
 XVisualInfo = Struct("XVisualInfo", [
   (Visual, "visual"),
@@ -206,14 +208,9 @@ GLXbuffer = Flags(Int, [
     "GLX_PBUFFER_CLOBBER_MASK",
 ])
 
-UnusedAttribs = AttribArray(GLXEnum, [])
+UnusedAttribs = AttribArray(Const(GLXEnum), [])
 
-GLXFBConfigCommonAttribs = [
-    ('GLX_BUFFER_SIZE', UInt),
-    ('GLX_LEVEL', Int),
-    ('GLX_DOUBLEBUFFER', Bool),
-    ('GLX_STEREO', Bool),
-    ('GLX_AUX_BUFFERS', UInt),
+GLXCommonSizeAttribs = [
     ('GLX_RED_SIZE', UInt),
     ('GLX_GREEN_SIZE', UInt),
     ('GLX_BLUE_SIZE', UInt),
@@ -223,7 +220,29 @@ GLXFBConfigCommonAttribs = [
     ('GLX_ACCUM_RED_SIZE', UInt),
     ('GLX_ACCUM_GREEN_SIZE', UInt),
     ('GLX_ACCUM_BLUE_SIZE', UInt),
-    ('GLX_ACCUM_ALPHA_SIZE', UInt),
+    ('GLX_ACCUM_ALPHA_SIZE', UInt)
+]
+
+GLXVisualAttribs = AttribArray(GLXEnum, GLXCommonSizeAttribs + [
+    ('GLX_USE_GL', None),
+    ('GLX_BUFFER_SIZE', UInt),
+    ('GLX_LEVEL', Int),
+    ('GLX_RGBA', None),
+    ('GLX_DOUBLEBUFFER', None),
+    ('GLX_STEREO', None),
+    ('GLX_AUX_BUFFERS', UInt),
+    ('GLX_SAMPLE_BUFFERS', UInt),
+    ('GLX_SAMPLES', UInt)],
+)
+
+GLXFBConfigCommonAttribs = GLXCommonSizeAttribs + [
+    ('GLX_BUFFER_SIZE', UInt),
+    ('GLX_LEVEL', Int),
+    ('GLX_DOUBLEBUFFER', Bool),
+    ('GLX_STEREO', Bool),
+    ('GLX_AUX_BUFFERS', UInt),
+    ('GLX_SAMPLE_BUFFERS', UInt),
+    ('GLX_SAMPLES', UInt),
     ('GLX_RENDER_TYPE', Flags(Int, ["GLX_RGBA_BIT", "GLX_COLOR_INDEX_BIT"])),
     ('GLX_DRAWABLE_TYPE', Flags(Int, ["GLX_WINDOW_BIT", "GLX_PIXMAP_BIT", "GLX_PBUFFER_BIT"])),
     ('GLX_X_RENDERABLE', Bool),
@@ -235,29 +254,27 @@ GLXFBConfigCommonAttribs = [
     ('GLX_TRANSPARENT_GREEN_VALUE', Int),
     ('GLX_TRANSPARENT_BLUE_VALUE', Int),
     ('GLX_TRANSPARENT_ALPHA_VALUE', Int)
-
 ]
 
 GLXFBConfigGLXAttribs = GLXFBConfigCommonAttribs + [
     ('GLX_FBCONFIG_ID', Int), # an XID, can we do better than int?
+    ('GLX_MAX_PBUFFER_WIDTH', Int),
+    ('GLX_MAX_PBUFFER_HEIGHT', Int),
+    ('GLX_MAX_PBUFFER_PIXELS', Int),
+    ('GLX_VISUAL_ID', Int)  # another XID
 ]
 
-GLXFBConfigSGIXAttribs = GLXFBConfigCommonAttribs + [
-    ('GLX_SAMPLE_BUFFERS', UInt),
-    ('GLX_SAMPLES', UInt)
-]
-
-GLXFBConfigAttribs = AttribArray(GLXEnum, GLXFBConfigGLXAttribs)
-GLXFBConfigSGIXAttribs = AttribArray(GLXEnum, GLXFBConfigSGIXAttribs, isConst = False)
+GLXFBConfigAttribs = AttribArray(Const(GLXEnum), GLXFBConfigGLXAttribs)
+GLXFBConfigSGIXAttribs = AttribArray(GLXEnum, GLXFBConfigCommonAttribs)
 
-GLXContextAttribs = AttribArray(GLXEnum, [
+GLXContextARBAttribs = AttribArray(Const(GLXEnum), [
     ('GLX_CONTEXT_MAJOR_VERSION_ARB', Int),
     ('GLX_CONTEXT_MINOR_VERSION_ARB', Int),
     ('GLX_CONTEXT_FLAGS_ARB', Flags(Int, ["GLX_CONTEXT_DEBUG_BIT_ARB", "GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB"])),
     ('GLX_CONTEXT_PROFILE_MASK_ARB', Flags(Int, ["GLX_CONTEXT_CORE_PROFILE_BIT_ARB", "GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB"]))
 ])
 
-GLXPbufferAttribs = AttribArray(GLXEnum, [
+GLXPbufferAttribs = AttribArray(Const(GLXEnum), [
     ('GLX_PBUFFER_WIDTH', Int),
     ('GLX_PBUFFER_HEIGHT', Int),
     ('GLX_LARGEST_PBUFFER', Bool),
@@ -268,7 +285,6 @@ GLXPbufferSGIXAttribs = AttribArray(GLXEnum, [
     ('GLX_PRESERVED_CONTENTS_SGIX', Bool),
     ('GLX_LARGEST_PBUFFER', Bool),
     ('GLX_DIGITAL_MEDIA_PBUFFER_SGIX', Bool)],
-    isConst = False
 )
 
 glxapi = Module("GLX")
@@ -277,7 +293,7 @@ PROC = Opaque("__GLXextFuncPtr")
 
 glxapi.addFunctions([
     # GLX
-    Function(Pointer(XVisualInfo), "glXChooseVisual", [(Display, "dpy"), (Int, "screen"), (Array(GLXEnum, "_AttribList_size(attribList)"), "attribList")]),
+    Function(Pointer(XVisualInfo), "glXChooseVisual", [(Display, "dpy"), (Int, "screen"), (GLXVisualAttribs, "attribList")]),
     Function(GLXContext, "glXCreateContext", [(Display, "dpy"), (Pointer(XVisualInfo), "vis"), (GLXContext, "shareList"), (Bool, "direct")]),
     Function(Void, "glXDestroyContext",  [(Display, "dpy"), (GLXContext, "ctx")]),
     Function(Bool, "glXMakeCurrent", [(Display, "dpy"), (GLXDrawable, "drawable"), (GLXContext, "ctx")]),
@@ -340,7 +356,7 @@ glxapi.addFunctions([
     # GLX_ARB_create_context
     Function(GLXContext, "glXCreateContextAttribsARB", [(Display, "dpy"), (GLXFBConfig, "config"),
                                                         (GLXContext, "share_context"), (Bool, "direct"),
-                                                        (GLXContextAttribs,  "attrib_list")]),
+                                                        (GLXContextARBAttribs,  "attrib_list")]),
 
     # GLX_SGI_swap_control
     Function(Int, "glXSwapIntervalSGI", [(Int, "interval")]),
@@ -443,16 +459,16 @@ glxapi.addFunctions([
     Function(Void, "glXReleaseTexImageEXT", [(Display, "display"), (GLXDrawable, "drawable"), (GLXEnum, "buffer")]),
 
     # GLX_NV_present_video
-    #Function(OpaquePointer(UInt), "glXEnumerateVideoDevicesNV", [(Display, "dpy"), (Int, "screen"), (OpaquePointer(Int), "nelements")]),
-    #Function(Int, "glXBindVideoDeviceNV", [(Display, "dpy"), (UInt, "video_slot"), (UInt, "video_device"), (UnusedAttribs, "attrib_list")]),
+    Function(Array(UInt, "(nelements ? *nelements : 0)"), "glXEnumerateVideoDevicesNV", [(Display, "dpy"), (Int, "screen"), Out(Pointer(Int), "nelements")]),
+    Function(Int, "glXBindVideoDeviceNV", [(Display, "dpy"), (UInt, "video_slot"), (UInt, "video_device"), (UnusedAttribs, "attrib_list")]),
 
     # GLX_NV_video_output
-    #Function(Int, "glXGetVideoDeviceNV", [(Display, "dpy"), (Int, "screen"), (Int, "numVideoDevices"), (OpaquePointer(GLXVideoDeviceNV), "pVideoDevice")]),
-    #Function(Int, "glXReleaseVideoDeviceNV", [(Display, "dpy"), (Int, "screen"), (GLXVideoDeviceNV, "VideoDevice")]),
-    #Function(Int, "glXBindVideoImageNV", [(Display, "dpy"), (GLXVideoDeviceNV, "VideoDevice"), (GLXPbuffer, "pbuf"), (Int, "iVideoBuffer")]),
-    #Function(Int, "glXReleaseVideoImageNV", [(Display, "dpy"), (GLXPbuffer, "pbuf")]),
-    #Function(Int, "glXSendPbufferToVideoNV", [(Display, "dpy"), (GLXPbuffer, "pbuf"), (Int, "iBufferType"), (OpaquePointer(ULong), "pulCounterPbuffer"), (GLboolean, "bBlock")]),
-    #Function(Int, "glXGetVideoInfoNV", [(Display, "dpy"), (Int, "screen"), (GLXVideoDeviceNV, "VideoDevice"), (OpaquePointer(ULong), "pulCounterOutputPbuffer"), (OpaquePointer(ULong), "pulCounterOutputVideo")]),
+    Function(Int, "glXGetVideoDeviceNV", [(Display, "dpy"), (Int, "screen"), (Int, "numVideoDevices"), Out(Array(GLXVideoDeviceNV, "numVideoDevices"), "pVideoDevice")]),
+    Function(Int, "glXReleaseVideoDeviceNV", [(Display, "dpy"), (Int, "screen"), (GLXVideoDeviceNV, "VideoDevice")]),
+    Function(Int, "glXBindVideoImageNV", [(Display, "dpy"), (GLXVideoDeviceNV, "VideoDevice"), (GLXPbuffer, "pbuf"), (Int, "iVideoBuffer")]),
+    Function(Int, "glXReleaseVideoImageNV", [(Display, "dpy"), (GLXPbuffer, "pbuf")]),
+    Function(Int, "glXSendPbufferToVideoNV", [(Display, "dpy"), (GLXPbuffer, "pbuf"), (Int, "iBufferType"), Out(Pointer(ULong), "pulCounterPbuffer"), (GLboolean, "bBlock")]),
+    Function(Int, "glXGetVideoInfoNV", [(Display, "dpy"), (Int, "screen"), (GLXVideoDeviceNV, "VideoDevice"), Out(Pointer(ULong), "pulCounterOutputPbuffer"), Out(Pointer(ULong), "pulCounterOutputVideo")], sideeffects=False),
 
     # GLX_NV_swap_group
     Function(Bool, "glXJoinSwapGroupNV", [(Display, "dpy"), (GLXDrawable, "drawable"), (GLuint, "group")]),
@@ -463,11 +479,11 @@ glxapi.addFunctions([
     Function(Bool, "glXResetFrameCountNV", [(Display, "dpy"), (Int, "screen")]),
 
     # GLX_NV_video_capture
-    #Function(Int, "glXBindVideoCaptureDeviceNV", [(Display, "dpy"), (UInt, "video_capture_slot"), (GLXVideoCaptureDeviceNV, "device")]),
-    #Function(OpaquePointer(GLXVideoCaptureDeviceNV), "glXEnumerateVideoCaptureDevicesNV", [(Display, "dpy"), (Int, "screen"), (OpaquePointer(Int), "nelements")]),
-    #Function(Void, "glXLockVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device")]),
-    #Function(Int, "glXQueryVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device"), (Int, "attribute"), (OpaquePointer(Int), "value")]),
-    #Function(Void, "glXReleaseVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device")]),
+    Function(Int, "glXBindVideoCaptureDeviceNV", [(Display, "dpy"), (UInt, "video_capture_slot"), (GLXVideoCaptureDeviceNV, "device")]),
+    Function(Array(GLXVideoCaptureDeviceNV, "(nelements ? *nelements : 0)"), "glXEnumerateVideoCaptureDevicesNV", [(Display, "dpy"), (Int, "screen"), Out(Pointer(Int), "nelements")]),
+    Function(Void, "glXLockVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device")]),
+    Function(Int, "glXQueryVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device"), (Int, "attribute"), Out(Pointer(Int), "value")], sideeffects=False),
+    Function(Void, "glXReleaseVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device")]),
 
     # GLX_EXT_swap_control
     Function(Void, "glXSwapIntervalEXT", [(Display, "dpy"), (GLXDrawable, "drawable"), (Int, "interval")]),