]> git.cworth.org Git - apitrace/blobdiff - specs/wglapi.py
attrib_list support for WGL function wglCreateContextAttribsARB.
[apitrace] / specs / wglapi.py
index ff789377027a5381ff429e44bee5ff5a0ffccdf5..f966df1c94d6c8e70216f59e3096614b47902c35 100644 (file)
@@ -32,7 +32,7 @@ from winapi import *
 from wglenum import *
 
 
-wglapi = API("WGL")
+wglapi = Module("WGL")
 
 
 HGLRC = Alias("HGLRC", HANDLE)
@@ -138,6 +138,14 @@ WGLSWAP = Struct("WGLSWAP", [
     (UINT, "uiFlags"),
 ])
 
+WGLContextAttribs = AttribArray(WGLenum, [
+    ('WGL_CONTEXT_MAJOR_VERSION_ARB', Int),
+    ('WGL_CONTEXT_MINOR_VERSION_ARB', Int),
+    ('WGL_CONTEXT_LAYER_PLANE_ARB', Int),
+    ('WGL_CONTEXT_FLAGS_ARB', Flags(Int, ["WGL_CONTEXT_DEBUG_BIT_ARB", "WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB"])),
+    ('WGL_CONTEXT_PROFILE_MASK_ARB', Flags(Int, ["WGL_CONTEXT_CORE_PROFILE_BIT_ARB", "WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB"]))
+])
+
 HPBUFFERARB = Alias("HPBUFFERARB", HANDLE)
 
 
@@ -175,7 +183,7 @@ wglapi.addFunctions([
     StdFunction(BOOL, "wglRestoreBufferRegionARB", [(HANDLE, "hRegion"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height"), (Int, "xSrc"), (Int, "ySrc")]),
 
     # WGL_ARB_extensions_string
-    StdFunction(Const(CString), "wglGetExtensionsStringARB", [(HDC, "hdc")], sideeffects=False),
+    StdFunction(ConstCString, "wglGetExtensionsStringARB", [(HDC, "hdc")], sideeffects=False),
 
     # WGL_ARB_pixel_format
     StdFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False),
@@ -199,10 +207,10 @@ wglapi.addFunctions([
     StdFunction(BOOL, "wglSetPbufferAttribARB", [(HPBUFFERARB, "hPbuffer"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribList)"), "piAttribList")]),
 
     # WGL_ARB_create_context
-    StdFunction(HGLRC, "wglCreateContextAttribsARB", [(HDC, "hDC"), (HGLRC, "hShareContext"), (Array(Const(WGLenum), "_AttribPairList_size(attribList)"), "attribList")]),
+    StdFunction(HGLRC, "wglCreateContextAttribsARB", [(HDC, "hDC"), (HGLRC, "hShareContext"), (WGLContextAttribs, "attribList")]),
 
     # WGL_EXT_extensions_string
-    StdFunction(Const(CString), "wglGetExtensionsStringEXT", [], sideeffects=False),
+    StdFunction(ConstCString, "wglGetExtensionsStringEXT", [], sideeffects=False),
 
     # WGL_EXT_make_current_read
     StdFunction(BOOL, "wglMakeContextCurrentEXT", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]),