]> git.cworth.org Git - apitrace/blob - specs/wglapi.py
9c4b13b47a56c2c356f1d8cfa8ee6b2d17176dbb
[apitrace] / specs / wglapi.py
1 ##########################################################################
2 #
3 # Copyright 2008-2010 VMware, Inc.
4 # All Rights Reserved.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 # THE SOFTWARE.
23 #
24 ##########################################################################/
25
26
27 """WGL API description"""
28
29
30 from glapi import *
31 from winapi import *
32 from wglenum import *
33
34
35 wglapi = Module("WGL")
36
37
38 HGLRC = Alias("HGLRC", HANDLE)
39 PROC = Opaque("PROC")
40
41 PFD = Flags(DWORD, [
42     "PFD_DOUBLEBUFFER",
43     "PFD_STEREO",
44     "PFD_DRAW_TO_WINDOW",
45     "PFD_DRAW_TO_BITMAP",
46     "PFD_SUPPORT_GDI",
47     "PFD_SUPPORT_OPENGL",
48     "PFD_GENERIC_FORMAT",
49     "PFD_NEED_PALETTE",
50     "PFD_NEED_SYSTEM_PALETTE",
51     "PFD_SWAP_EXCHANGE",
52     "PFD_SWAP_COPY",
53     "PFD_SWAP_LAYER_BUFFERS",
54     "PFD_GENERIC_ACCELERATED",
55     "PFD_SUPPORT_DIRECTDRAW",
56     "PFD_SUPPORT_COMPOSITION",
57     "PFD_DEPTH_DONTCARE",
58     "PFD_DOUBLEBUFFER_DONTCARE",
59     "PFD_STEREO_DONTCARE",
60 ])
61
62 PIXELFORMATDESCRIPTOR = Struct("PIXELFORMATDESCRIPTOR", [
63     (WORD, "nSize"),
64     (WORD, "nVersion"),
65     (PFD, "dwFlags"),
66     (BYTE, "iPixelType"),
67     (BYTE, "cColorBits"),
68     (BYTE, "cRedBits"),
69     (BYTE, "cRedShift"),
70     (BYTE, "cGreenBits"),
71     (BYTE, "cGreenShift"),
72     (BYTE, "cBlueBits"),
73     (BYTE, "cBlueShift"),
74     (BYTE, "cAlphaBits"),
75     (BYTE, "cAlphaShift"),
76     (BYTE, "cAccumBits"),
77     (BYTE, "cAccumRedBits"),
78     (BYTE, "cAccumGreenBits"),
79     (BYTE, "cAccumBlueBits"),
80     (BYTE, "cAccumAlphaBits"),
81     (BYTE, "cDepthBits"),
82     (BYTE, "cStencilBits"),
83     (BYTE, "cAuxBuffers"),
84     (BYTE, "iLayerType"),
85     (BYTE, "bReserved"),
86     (DWORD, "dwLayerMask"),
87     (DWORD, "dwVisibleMask"),
88     (DWORD, "dwDamageMask"),
89 ])
90
91 POINTFLOAT = Struct("POINTFLOAT", [
92     (FLOAT, "x"),
93     (FLOAT, "y"),
94 ])
95
96 GLYPHMETRICSFLOAT = Struct("GLYPHMETRICSFLOAT", [
97     (FLOAT, "gmfBlackBoxX"),
98     (FLOAT, "gmfBlackBoxY"),
99     (POINTFLOAT, "gmfptGlyphOrigin"),
100     (FLOAT, "gmfCellIncX"),
101     (FLOAT, "gmfCellIncY"),
102 ])
103 LPGLYPHMETRICSFLOAT = Pointer(GLYPHMETRICSFLOAT)
104
105 COLORREF = Alias("COLORREF", DWORD)
106
107
108 LAYERPLANEDESCRIPTOR = Struct("LAYERPLANEDESCRIPTOR", [
109     (WORD, "nSize"),
110     (WORD, "nVersion"),
111     (DWORD, "dwFlags"),
112     (BYTE, "iPixelType"),
113     (BYTE, "cColorBits"),
114     (BYTE, "cRedBits"),
115     (BYTE, "cRedShift"),
116     (BYTE, "cGreenBits"),
117     (BYTE, "cGreenShift"),
118     (BYTE, "cBlueBits"),
119     (BYTE, "cBlueShift"),
120     (BYTE, "cAlphaBits"),
121     (BYTE, "cAlphaShift"),
122     (BYTE, "cAccumBits"),
123     (BYTE, "cAccumRedBits"),
124     (BYTE, "cAccumGreenBits"),
125     (BYTE, "cAccumBlueBits"),
126     (BYTE, "cAccumAlphaBits"),
127     (BYTE, "cDepthBits"),
128     (BYTE, "cStencilBits"),
129     (BYTE, "cAuxBuffers"),
130     (BYTE, "iLayerPlane"),
131     (BYTE, "bReserved"),
132     (COLORREF, "crTransparent"),
133 ])
134 LPLAYERPLANEDESCRIPTOR = Pointer(LAYERPLANEDESCRIPTOR)
135
136 WGLSWAP = Struct("WGLSWAP", [
137     (HDC, "hdc"),
138     (UINT, "uiFlags"),
139 ])
140
141 WGLContextAttribs = AttribArray(WGLenum, [
142     ('WGL_CONTEXT_MAJOR_VERSION_ARB', Int),
143     ('WGL_CONTEXT_MINOR_VERSION_ARB', Int),
144     ('WGL_CONTEXT_LAYER_PLANE_ARB', Int),
145     ('WGL_CONTEXT_FLAGS_ARB', Flags(Int, ["WGL_CONTEXT_DEBUG_BIT_ARB", "WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB"])),
146     ('WGL_CONTEXT_PROFILE_MASK_ARB', Flags(Int, ["WGL_CONTEXT_CORE_PROFILE_BIT_ARB", "WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB"]))
147 ])
148
149 WGLPixelFormatAttribsList = [
150     ('WGL_DRAW_TO_WINDOW_ARB', BOOL),
151     ('WGL_DRAW_TO_BITMAP_ARB', BOOL),
152     ('WGL_ACCELERATION_ARB', FakeEnum(Int, ['WGL_NO_ACCELERATION_ARB', 'WGL_GENERIC_ACCELERATION_ARB', 'WGL_FULL_ACCELERATION_ARB'])),
153     ('WGL_NEED_PALETTE_ARB', BOOL),
154     ('WGL_NEED_SYSTEM_PALETTE_ARB', BOOL),
155     ('WGL_SWAP_LAYER_BUFFERS_ARB', BOOL),
156     ('WGL_SWAP_METHOD_ARB', FakeEnum(Int, ['WGL_SWAP_EXCHANGE_ARB', 'WGL_SWAP_COPY_ARB', 'WGL_SWAP_UNDEFINED_ARB'])),
157     ('WGL_NUMBER_OVERLAYS_ARB', Int),
158     ('WGL_NUMBER_UNDERLAYS_ARB', Int),
159     ('WGL_TRANSPARENT_EXT', BOOL),
160     ('WGL_TRANSPARENT_VALUE_EXT', Int),
161     ('WGL_SHARE_DEPTH_ARB', BOOL),
162     ('WGL_SHARE_STENCIL_ARB', BOOL),
163     ('WGL_SHARE_ACCUM_ARB', BOOL),
164     ('WGL_SUPPORT_GDI_ARB', BOOL),
165     ('WGL_SUPPORT_OPENGL_ARB', BOOL),
166     ('WGL_DOUBLE_BUFFER_ARB', BOOL),
167     ('WGL_STEREO_ARB', BOOL),
168     ('WGL_PIXEL_TYPE_ARB', FakeEnum(Int, ['WGL_TYPE_RGBA_ARB', 'WGL_TYPE_COLORINDEX_ARB'])),
169     ('WGL_COLOR_BITS_ARB', Int),
170     ('WGL_RED_BITS_ARB', Int),
171     ('WGL_RED_SHIFT_EXT', Int),
172     ('WGL_GREEN_BITS_ARB', Int),
173     ('WGL_GREEN_SHIFT_EXT', Int),
174     ('WGL_BLUE_BITS_ARB', Int),
175     ('WGL_BLUE_SHIFT_EXT', Int),
176     ('WGL_ALPHA_BITS_ARB', Int),
177     ('WGL_ALPHA_SHIFT_EXT', Int),
178     ('WGL_ACCUM_BITS_ARB', Int),
179     ('WGL_ACCUM_RED_BITS_ARB', Int),
180     ('WGL_ACCUM_GREEN_BITS_ARB', Int),
181     ('WGL_ACCUM_BLUE_BITS_ARB', Int),
182     ('WGL_ACCUM_ALPHA_BITS_ARB', Int),
183     ('WGL_DEPTH_BITS_ARB', Int),
184     ('WGL_STENCIL_BITS_ARB', Int),
185     ('WGL_AUX_BUFFERS_ARB', Int),
186     ('WGL_SAMPLE_BUFFERS_ARB', Int),
187     ('WGL_SAMPLES_ARB', Int),
188 ]
189
190 WGLPixelFormatAttribs = AttribArray(WGLenum, WGLPixelFormatAttribsList)
191 WGLPixelFormatFloatAttribs = AttribArray(FLOAT, WGLPixelFormatAttribsList)
192
193 WGLCreatePbufferARBAttribs = AttribArray(WGLenum, [
194     ('WGL_PBUFFER_LARGEST_ARB', Int)
195 ])
196
197 CubeFaceEnum = FakeEnum(Int, [
198     'WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB',
199     'WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB',
200     'WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB',
201     'WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB',
202     'WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB',
203     'WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB'
204 ])
205
206 WGLSetPbufferARBAttribs = AttribArray(WGLenum, [
207     ('WGL_MIPMAP_LEVEL_ARB', Int),
208     ('WGL_CUBE_MAP_FACE_ARB', CubeFaceEnum)
209 ])
210
211 HPBUFFERARB = Alias("HPBUFFERARB", HANDLE)
212 HPBUFFEREXT = Alias("HPBUFFEREXT", HANDLE)
213 HPVIDEODEV = Alias("HPVIDEODEV", HANDLE)
214 HVIDEOOUTPUTDEVICENV = Alias("HVIDEOOUTPUTDEVICENV", HANDLE)
215 HVIDEOINPUTDEVICENV = Alias("HVIDEOINPUTDEVICENV", HANDLE)
216 HGPUNV = Alias("HGPUNV", HANDLE)
217
218 GPU_DEVICE = Struct("GPU_DEVICE", [
219     (DWORD, "cb"),
220     (CString, "DeviceName"),
221     (CString, "DeviceString"),
222     (DWORD, "Flags"),
223     (RECT, "rcVirtualScreen"),
224 ])
225
226
227 wglapi.addFunctions([
228     # WGL
229     StdFunction(HGLRC, "wglCreateContext", [(HDC, "hdc")]),
230     StdFunction(BOOL, "wglDeleteContext", [(HGLRC, "hglrc")]),
231     StdFunction(HGLRC, "wglGetCurrentContext", [], sideeffects=False),
232     StdFunction(BOOL, "wglMakeCurrent", [(HDC, "hdc"), (HGLRC, "hglrc")]),
233     StdFunction(BOOL, "wglCopyContext", [(HGLRC, "hglrcSrc"), (HGLRC, "hglrcDst"), (UINT, "mask")]),
234     StdFunction(Int, "wglChoosePixelFormat", [(HDC, "hdc"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]), 
235     StdFunction(Int, "wglDescribePixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (UINT, "nBytes"), Out(Pointer(PIXELFORMATDESCRIPTOR), "ppfd")]),
236     StdFunction(HDC, "wglGetCurrentDC", [], sideeffects=False),
237     StdFunction(PROC, "wglGetDefaultProcAddress", [(LPCSTR, "lpszProc")], sideeffects=False),
238     StdFunction(Int, "wglGetPixelFormat", [(HDC, "hdc")], sideeffects=False),
239     StdFunction(BOOL, "wglSetPixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]),
240     StdFunction(BOOL, "wglSwapBuffers", [(HDC, "hdc")]),
241     StdFunction(BOOL, "wglShareLists", [(HGLRC, "hglrc1"), (HGLRC, "hglrc2")]),
242     StdFunction(HGLRC, "wglCreateLayerContext", [(HDC, "hdc"), (Int, "iLayerPlane")]),
243     StdFunction(BOOL, "wglDescribeLayerPlane", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nBytes"), Out(Pointer(LAYERPLANEDESCRIPTOR), "plpd")]),
244     StdFunction(Int, "wglSetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), (Array(Const(COLORREF), "cEntries"), "pcr")]),
245     StdFunction(Int, "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), Out(Array(COLORREF, "cEntries"), "pcr")], sideeffects=False),
246     StdFunction(BOOL, "wglRealizeLayerPalette", [(HDC, "hdc"), (Int, "iLayerPlane"), (BOOL, "bRealize")]),
247     StdFunction(BOOL, "wglSwapLayerBuffers", [(HDC, "hdc"), (UINT, "fuPlanes")]),
248     StdFunction(BOOL, "wglUseFontBitmapsA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]),
249     StdFunction(BOOL, "wglUseFontBitmapsW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]),
250     StdFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Array(Const(WGLSWAP), "n"), "ps")]),
251     StdFunction(BOOL, "wglUseFontOutlinesA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]),
252     StdFunction(BOOL, "wglUseFontOutlinesW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]),
253
254     # WGL_ARB_buffer_region
255     StdFunction(HANDLE, "wglCreateBufferRegionARB", [(HDC, "hDC"), (Int, "iLayerPlane"), (UINT, "uType")]),
256     StdFunction(VOID, "wglDeleteBufferRegionARB", [(HANDLE, "hRegion")]),
257     StdFunction(BOOL, "wglSaveBufferRegionARB", [(HANDLE, "hRegion"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height")]),
258     StdFunction(BOOL, "wglRestoreBufferRegionARB", [(HANDLE, "hRegion"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height"), (Int, "xSrc"), (Int, "ySrc")]),
259
260     # WGL_ARB_extensions_string
261     StdFunction(ConstCString, "wglGetExtensionsStringARB", [(HDC, "hdc")], sideeffects=False),
262
263     # WGL_ARB_pixel_format
264     StdFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False),
265     StdFunction(BOOL, "wglGetPixelFormatAttribfvARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False),
266     StdFunction(BOOL, "wglChoosePixelFormatARB", [(HDC, "hdc"), (WGLPixelFormatAttribs, "piAttribIList"), (WGLPixelFormatFloatAttribs, "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "(*nNumFormats)"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]),
267
268     # WGL_ARB_make_current_read
269     StdFunction(BOOL, "wglMakeContextCurrentARB", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]),
270     StdFunction(HDC, "wglGetCurrentReadDCARB", [], sideeffects=False),
271
272     # WGL_ARB_pbuffer
273     StdFunction(HPBUFFERARB, "wglCreatePbufferARB", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (WGLCreatePbufferARBAttribs, "piAttribList")]),
274     StdFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")]),
275     StdFunction(Int, "wglReleasePbufferDCARB", [(HPBUFFERARB, "hPbuffer"), (HDC, "hDC")]),
276     StdFunction(BOOL, "wglDestroyPbufferARB", [(HPBUFFERARB, "hPbuffer")]),
277     StdFunction(BOOL, "wglQueryPbufferARB", [(HPBUFFERARB, "hPbuffer"), (WGLenum, "iAttribute"), Out(Pointer(Int), "piValue")], sideeffects=False),
278
279     # WGL_ARB_render_texture
280     StdFunction(BOOL, "wglBindTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]),
281     StdFunction(BOOL, "wglReleaseTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]),
282     StdFunction(BOOL, "wglSetPbufferAttribARB", [(HPBUFFERARB, "hPbuffer"), (WGLSetPbufferARBAttribs, "piAttribList")]),
283
284     # WGL_ARB_create_context
285     StdFunction(HGLRC, "wglCreateContextAttribsARB", [(HDC, "hDC"), (HGLRC, "hShareContext"), (WGLContextAttribs, "attribList")]),
286
287     # WGL_EXT_display_color_table
288     StdFunction(GLboolean, "wglCreateDisplayColorTableEXT", [(GLushort, "id")]),
289     StdFunction(GLboolean, "wglLoadDisplayColorTableEXT", [(Array(Const(GLushort), "length"), "table"), (GLuint, "length")]),
290     StdFunction(GLboolean, "wglBindDisplayColorTableEXT", [(GLushort, "id")]),
291     StdFunction(VOID, "wglDestroyDisplayColorTableEXT", [(GLushort, "id")]),
292
293     # WGL_EXT_extensions_string
294     StdFunction(ConstCString, "wglGetExtensionsStringEXT", [], sideeffects=False),
295
296     # WGL_EXT_make_current_read
297     StdFunction(BOOL, "wglMakeContextCurrentEXT", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]),
298     StdFunction(HDC, "wglGetCurrentReadDCEXT", [], sideeffects=False),
299
300     # WGL_EXT_pbuffer
301     StdFunction(HPBUFFEREXT, "wglCreatePbufferEXT", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (WGLCreatePbufferARBAttribs, "piAttribList")]),
302     StdFunction(HDC, "wglGetPbufferDCEXT", [(HPBUFFEREXT, "hPbuffer")], sideeffects=False),
303     StdFunction(Int, "wglReleasePbufferDCEXT", [(HPBUFFEREXT, "hPbuffer"), (HDC, "hDC")]),
304     StdFunction(BOOL, "wglDestroyPbufferEXT", [(HPBUFFEREXT, "hPbuffer")]),
305     StdFunction(BOOL, "wglQueryPbufferEXT", [(HPBUFFEREXT, "hPbuffer"), (WGLenum, "iAttribute"), Out(Pointer(Int), "piValue")], sideeffects=False),
306
307     # WGL_EXT_pixel_format
308     StdFunction(BOOL, "wglGetPixelFormatAttribivEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False),
309     StdFunction(BOOL, "wglGetPixelFormatAttribfvEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False),
310     StdFunction(BOOL, "wglChoosePixelFormatEXT", [(HDC, "hdc"), (WGLPixelFormatAttribs, "piAttribIList"), (WGLPixelFormatFloatAttribs, "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "*nNumFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]),
311
312     # WGL_EXT_swap_control
313     StdFunction(BOOL, "wglSwapIntervalEXT", [(Int, "interval")]),
314     StdFunction(Int, "wglGetSwapIntervalEXT", [], sideeffects=False),
315
316     # WGL_NV_vertex_array_range
317     StdFunction(OpaquePointer(Void), "wglAllocateMemoryNV", [(GLsizei, "size"), (GLfloat, "readfreq"), (GLfloat, "writefreq"), (GLfloat, "priority")]),
318     StdFunction(Void, "wglFreeMemoryNV", [(OpaquePointer(Void), "pointer")]),
319
320     # WGL_OML_sync_control
321     StdFunction(BOOL, "wglGetSyncValuesOML", [(HDC, "hdc"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")], sideeffects=False),
322     StdFunction(BOOL, "wglGetMscRateOML", [(HDC, "hdc"), Out(Pointer(INT32), "numerator"), Out(Pointer(INT32), "denominator")], sideeffects=False),
323     StdFunction(INT64, "wglSwapBuffersMscOML", [(HDC, "hdc"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder")]),
324     StdFunction(INT64, "wglSwapLayerBuffersMscOML", [(HDC, "hdc"), (Int, "fuPlanes"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder")]),
325     StdFunction(BOOL, "wglWaitForMscOML", [(HDC, "hdc"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")]),
326     StdFunction(BOOL, "wglWaitForSbcOML", [(HDC, "hdc"), (INT64, "target_sbc"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")]),
327
328     # WGL_I3D_digital_video_control
329     StdFunction(BOOL, "wglGetDigitalVideoParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), Out(OpaqueArray(Int, "_wglGetDigitalVideoParametersI3D_size(iAttribute)"), "piValue")], sideeffects=False),
330     StdFunction(BOOL, "wglSetDigitalVideoParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), (OpaqueArray(Const(Int), "_wglSetDigitalVideoParametersI3D_size(iAttribute)"), "piValue")]),
331
332     # WGL_I3D_gamma
333     StdFunction(BOOL, "wglGetGammaTableParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), Out(OpaqueArray(Int, "_wglGetGammaTableParametersI3D_size(iAttribute)"), "piValue")], sideeffects=False),
334     StdFunction(BOOL, "wglSetGammaTableParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), (OpaqueArray(Const(Int), "_wglSetGammaTableParametersI3D_size(iAttribute)"), "piValue")]),
335     StdFunction(BOOL, "wglGetGammaTableI3D", [(HDC, "hDC"), (Int, "iEntries"), Out(Array(USHORT, "iEntries"), "puRed"), Out(Array(USHORT, "iEntries"), "puGreen"), Out(Array(USHORT, "iEntries"), "puBlue")], sideeffects=False),
336     StdFunction(BOOL, "wglSetGammaTableI3D", [(HDC, "hDC"), (Int, "iEntries"), (Array(Const(USHORT), "iEntries"), "puRed"), (Array(Const(USHORT), "iEntries"), "puGreen"), (Array(Const(USHORT), "iEntries"), "puBlue")]),
337
338     # WGL_I3D_genlock
339     StdFunction(BOOL, "wglEnableGenlockI3D", [(HDC, "hDC")]),
340     StdFunction(BOOL, "wglDisableGenlockI3D", [(HDC, "hDC")]),
341     StdFunction(BOOL, "wglIsEnabledGenlockI3D", [(HDC, "hDC"), Out(Pointer(BOOL), "pFlag")], sideeffects=False),
342     StdFunction(BOOL, "wglGenlockSourceI3D", [(HDC, "hDC"), (UINT, "uSource")]),
343     StdFunction(BOOL, "wglGetGenlockSourceI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uSource")], sideeffects=False),
344     StdFunction(BOOL, "wglGenlockSourceEdgeI3D", [(HDC, "hDC"), (UINT, "uEdge")]),
345     StdFunction(BOOL, "wglGetGenlockSourceEdgeI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uEdge")], sideeffects=False),
346     StdFunction(BOOL, "wglGenlockSampleRateI3D", [(HDC, "hDC"), (UINT, "uRate")]),
347     StdFunction(BOOL, "wglGetGenlockSampleRateI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uRate")], sideeffects=False),
348     StdFunction(BOOL, "wglGenlockSourceDelayI3D", [(HDC, "hDC"), (UINT, "uDelay")]),
349     StdFunction(BOOL, "wglGetGenlockSourceDelayI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uDelay")], sideeffects=False),
350     StdFunction(BOOL, "wglQueryGenlockMaxSourceDelayI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uMaxLineDelay"), Out(Pointer(UINT), "uMaxPixelDelay")]),
351
352     # WGL_I3D_image_buffer
353     StdFunction(LPVOID, "wglCreateImageBufferI3D", [(HDC, "hDC"), (DWORD, "dwSize"), (UINT, "uFlags")]),
354     StdFunction(BOOL, "wglDestroyImageBufferI3D", [(HDC, "hDC"), (LPVOID, "pAddress")]),
355     StdFunction(BOOL, "wglAssociateImageBufferEventsI3D", [(HDC, "hDC"), (Array(Const(HANDLE), "count"), "pEvent"), (Array(Const(LPVOID), "count"), "pAddress"), (Array(Const(DWORD), "count"), "pSize"), (UINT, "count")]),
356     StdFunction(BOOL, "wglReleaseImageBufferEventsI3D", [(HDC, "hDC"), (Array(Const(LPVOID), "count"), "pAddress"), (UINT, "count")]),
357
358     # WGL_I3D_swap_frame_lock
359     StdFunction(BOOL, "wglEnableFrameLockI3D", []),
360     StdFunction(BOOL, "wglDisableFrameLockI3D", []),
361     StdFunction(BOOL, "wglIsEnabledFrameLockI3D", [Out(Pointer(BOOL), "pFlag")], sideeffects=False),
362     StdFunction(BOOL, "wglQueryFrameLockMasterI3D", [Out(Pointer(BOOL), "pFlag")]),
363
364     # WGL_I3D_swap_frame_usage
365     StdFunction(BOOL, "wglGetFrameUsageI3D", [Out(Pointer(Float), "pUsage")], sideeffects=False),
366     StdFunction(BOOL, "wglBeginFrameTrackingI3D", []),
367     StdFunction(BOOL, "wglEndFrameTrackingI3D", []),
368     StdFunction(BOOL, "wglQueryFrameTrackingI3D", [Out(Pointer(DWORD), "pFrameCount"), Out(Pointer(DWORD), "pMissedFrames"), Out(Pointer(Float), "pLastMissedUsage")]),
369
370     # WGL_3DL_stereo_control
371     StdFunction(BOOL, "wglSetStereoEmitterState3DL", [(HDC, "hDC"), (UINT, "uState")]),
372
373     # WGL_NV_present_video
374     StdFunction(Int, "wglEnumerateVideoDevicesNV", [(HDC, "hDC"), Out(OpaquePointer(HVIDEOOUTPUTDEVICENV), "phDeviceList")]),
375     StdFunction(BOOL, "wglBindVideoDeviceNV", [(HDC, "hDC"), (UInt, "uVideoSlot"), (HVIDEOOUTPUTDEVICENV, "hVideoDevice"), (OpaqueArray(Const(Int), "_wglBindVideoDeviceNV_size()"), "piAttribList")]),
376     StdFunction(BOOL, "wglQueryCurrentContextNV", [(Int, "iAttribute"), Out(OpaqueArray(Int, "_wglQueryCurrentContextNV_size()"), "piValue")]),
377
378     # WGL_NV_video_output
379     StdFunction(BOOL, "wglGetVideoDeviceNV", [(HDC, "hDC"), (Int, "numDevices"), Out(Pointer(HPVIDEODEV), "hVideoDevice")], sideeffects=False),
380     StdFunction(BOOL, "wglReleaseVideoDeviceNV", [(HPVIDEODEV, "hVideoDevice")]),
381     StdFunction(BOOL, "wglBindVideoImageNV", [(HPVIDEODEV, "hVideoDevice"), (HPBUFFERARB, "hPbuffer"), (Int, "iVideoBuffer")]),
382     StdFunction(BOOL, "wglReleaseVideoImageNV", [(HPBUFFERARB, "hPbuffer"), (Int, "iVideoBuffer")]),
383     StdFunction(BOOL, "wglSendPbufferToVideoNV", [(HPBUFFERARB, "hPbuffer"), (Int, "iBufferType"), Out(Pointer(ULong), "pulCounterPbuffer"), (BOOL, "bBlock")]),
384     StdFunction(BOOL, "wglGetVideoInfoNV", [(HPVIDEODEV, "hpVideoDevice"), Out(Pointer(ULong), "pulCounterOutputPbuffer"), Out(Pointer(ULong), "pulCounterOutputVideo")], sideeffects=False),
385
386     # WGL_NV_swap_group
387     StdFunction(BOOL, "wglJoinSwapGroupNV", [(HDC, "hDC"), (GLuint, "group")]),
388     StdFunction(BOOL, "wglBindSwapBarrierNV", [(GLuint, "group"), (GLuint, "barrier")]),
389     StdFunction(BOOL, "wglQuerySwapGroupNV", [(HDC, "hDC"), Out(Pointer(GLuint), "group"), Out(Pointer(GLuint), "barrier")]),
390     StdFunction(BOOL, "wglQueryMaxSwapGroupsNV", [(HDC, "hDC"), Out(Pointer(GLuint), "maxGroups"), Out(Pointer(GLuint), "maxBarriers")]),
391     StdFunction(BOOL, "wglQueryFrameCountNV", [(HDC, "hDC"), Out(Pointer(GLuint), "count")]),
392     StdFunction(BOOL, "wglResetFrameCountNV", [(HDC, "hDC")]),
393
394     # WGL_NV_gpu_affinity
395     StdFunction(BOOL, "wglEnumGpusNV", [(UINT, "iGpuIndex"), Out(Pointer(HGPUNV), "phGpu")]),
396     StdFunction(BOOL, "wglEnumGpuDevicesNV", [(HGPUNV, "hGpu"), (UINT, "iDeviceIndex"), Out(Pointer(GPU_DEVICE), "lpGpuDevice")]),
397     StdFunction(HDC, "wglCreateAffinityDCNV", [(OpaqueArray(Const(HGPUNV), "_wglCreateAffinityDCNV_size()"), "phGpuList")]),
398     StdFunction(BOOL, "wglEnumGpusFromAffinityDCNV", [(HDC, "hAffinityDC"), (UINT, "iGpuIndex"), Out(Pointer(HGPUNV), "hGpu")]),
399     StdFunction(BOOL, "wglDeleteDCNV", [(HDC, "hdc")]),
400
401     # WGL_AMD_gpu_association
402     StdFunction(UINT, "wglGetGPUIDsAMD", [(UINT, "maxCount"), Out(Array(UINT, "maxCount"), "ids")], sideeffects=False),
403     StdFunction(INT, "wglGetGPUInfoAMD", [(UINT, "id"), (Int, "property"), (GLenum, "dataType"), (UINT, "size"), Out(OpaqueBlob(Void, "_wglGetGPUInfoAMD_size(dataType,size)"), "data")], sideeffects=False),
404     StdFunction(UINT, "wglGetContextGPUIDAMD", [(HGLRC, "hglrc")], sideeffects=False),
405     StdFunction(HGLRC, "wglCreateAssociatedContextAMD", [(UINT, "id")]),
406     StdFunction(HGLRC, "wglCreateAssociatedContextAttribsAMD", [(UINT, "id"), (HGLRC, "hShareContext"), (OpaqueArray(Const(Int), "_wglCreateAssociatedContextAttribsAMD_size()"), "attribList")]),
407     StdFunction(BOOL, "wglDeleteAssociatedContextAMD", [(HGLRC, "hglrc")]),
408     StdFunction(BOOL, "wglMakeAssociatedContextCurrentAMD", [(HGLRC, "hglrc")]),
409     StdFunction(HGLRC, "wglGetCurrentAssociatedContextAMD", [], sideeffects=False),
410     StdFunction(VOID, "wglBlitContextFramebufferAMD", [(HGLRC, "dstCtx"), (GLint, "srcX0"), (GLint, "srcY0"), (GLint, "srcX1"), (GLint, "srcY1"), (GLint, "dstX0"), (GLint, "dstY0"), (GLint, "dstX1"), (GLint, "dstY1"), (GLbitfield, "mask"), (GLenum, "filter")]),
411
412     # WGL_NV_video_capture
413     StdFunction(BOOL, "wglBindVideoCaptureDeviceNV", [(UINT, "uVideoSlot"), (HVIDEOINPUTDEVICENV, "hDevice")]),
414     StdFunction(UINT, "wglEnumerateVideoCaptureDevicesNV", [(HDC, "hDc"), Out(Pointer(HVIDEOINPUTDEVICENV), "phDeviceList")]),
415     StdFunction(BOOL, "wglLockVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice")]),
416     StdFunction(BOOL, "wglQueryVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice"), (Int, "iAttribute"), Out(Pointer(Int), "piValue")]),
417     StdFunction(BOOL, "wglReleaseVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice")]),
418
419     # WGL_NV_copy_image
420     StdFunction(BOOL, "wglCopyImageSubDataNV", [(HGLRC, "hSrcRC"), (GLuint, "srcName"), (GLenum, "srcTarget"), (GLint, "srcLevel"), (GLint, "srcX"), (GLint, "srcY"), (GLint, "srcZ"), (HGLRC, "hDstRC"), (GLuint, "dstName"), (GLenum, "dstTarget"), (GLint, "dstLevel"), (GLint, "dstX"), (GLint, "dstY"), (GLint, "dstZ"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth")]),
421
422     # WGL_NV_DX_interop
423     StdFunction(BOOL, "wglDXSetResourceShareHandleNV", [(OpaquePointer(Void), "dxObject"), (HANDLE, "shareHandle")]),
424     StdFunction(HANDLE, "wglDXOpenDeviceNV", [(OpaquePointer(Void), "dxDevice")]),
425     StdFunction(BOOL, "wglDXCloseDeviceNV", [(HANDLE, "hDevice")]),
426     StdFunction(HANDLE, "wglDXRegisterObjectNV", [(HANDLE, "hDevice"), (OpaquePointer(Void), "dxObject"), (GLuint, "name"), (GLenum, "type"), (GLenum, "access")]),
427     StdFunction(BOOL, "wglDXUnregisterObjectNV", [(HANDLE, "hDevice"), (HANDLE, "hObject")]),
428     StdFunction(BOOL, "wglDXObjectAccessNV", [(HANDLE, "hObject"), (GLenum, "access")]),
429     StdFunction(BOOL, "wglDXLockObjectsNV", [(HANDLE, "hDevice"), (GLint, "count"), Out(Array(HANDLE, "count"), "hObjects")]),
430     StdFunction(BOOL, "wglDXUnlockObjectsNV", [(HANDLE, "hDevice"), (GLint, "count"), Out(Array(HANDLE, "count"), "hObjects")]),
431
432     # must be last
433     StdFunction(PROC, "wglGetProcAddress", [(LPCSTR, "lpszProc")]),
434 ])