]> git.cworth.org Git - apitrace/blob - specs/wglapi.py
qapitrace: Add option to replay in singlethreaded mode
[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 HPBUFFERARB = Alias("HPBUFFERARB", HANDLE)
142 HPBUFFEREXT = Alias("HPBUFFEREXT", HANDLE)
143 HPVIDEODEV = Alias("HPVIDEODEV", HANDLE)
144 HVIDEOOUTPUTDEVICENV = Alias("HVIDEOOUTPUTDEVICENV", HANDLE)
145 HVIDEOINPUTDEVICENV = Alias("HVIDEOINPUTDEVICENV", HANDLE)
146 HGPUNV = Alias("HGPUNV", HANDLE)
147
148 GPU_DEVICE = Struct("GPU_DEVICE", [
149     (DWORD, "cb"),
150     (CString, "DeviceName"),
151     (CString, "DeviceString"),
152     (DWORD, "Flags"),
153     (RECT, "rcVirtualScreen"),
154 ])
155
156
157 wglapi.addFunctions([
158     # WGL
159     StdFunction(HGLRC, "wglCreateContext", [(HDC, "hdc")]),
160     StdFunction(BOOL, "wglDeleteContext", [(HGLRC, "hglrc")]),
161     StdFunction(HGLRC, "wglGetCurrentContext", [], sideeffects=False),
162     StdFunction(BOOL, "wglMakeCurrent", [(HDC, "hdc"), (HGLRC, "hglrc")]),
163     StdFunction(BOOL, "wglCopyContext", [(HGLRC, "hglrcSrc"), (HGLRC, "hglrcDst"), (UINT, "mask")]),
164     StdFunction(Int, "wglChoosePixelFormat", [(HDC, "hdc"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]), 
165     StdFunction(Int, "wglDescribePixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (UINT, "nBytes"), Out(Pointer(PIXELFORMATDESCRIPTOR), "ppfd")]),
166     StdFunction(HDC, "wglGetCurrentDC", [], sideeffects=False),
167     StdFunction(PROC, "wglGetDefaultProcAddress", [(LPCSTR, "lpszProc")], sideeffects=False),
168     StdFunction(Int, "wglGetPixelFormat", [(HDC, "hdc")], sideeffects=False),
169     StdFunction(BOOL, "wglSetPixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]),
170     StdFunction(BOOL, "wglSwapBuffers", [(HDC, "hdc")]),
171     StdFunction(BOOL, "wglShareLists", [(HGLRC, "hglrc1"), (HGLRC, "hglrc2")]),
172     StdFunction(HGLRC, "wglCreateLayerContext", [(HDC, "hdc"), (Int, "iLayerPlane")]),
173     StdFunction(BOOL, "wglDescribeLayerPlane", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nBytes"), Out(Pointer(LAYERPLANEDESCRIPTOR), "plpd")]),
174     StdFunction(Int, "wglSetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), (Array(Const(COLORREF), "cEntries"), "pcr")]),
175     StdFunction(Int, "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), Out(Array(COLORREF, "cEntries"), "pcr")], sideeffects=False),
176     StdFunction(BOOL, "wglRealizeLayerPalette", [(HDC, "hdc"), (Int, "iLayerPlane"), (BOOL, "bRealize")]),
177     StdFunction(BOOL, "wglSwapLayerBuffers", [(HDC, "hdc"), (UINT, "fuPlanes")]),
178     StdFunction(BOOL, "wglUseFontBitmapsA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]),
179     StdFunction(BOOL, "wglUseFontBitmapsW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]),
180     StdFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Array(Const(WGLSWAP), "n"), "ps")]),
181     StdFunction(BOOL, "wglUseFontOutlinesA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]),
182     StdFunction(BOOL, "wglUseFontOutlinesW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]),
183
184     # WGL_ARB_buffer_region
185     StdFunction(HANDLE, "wglCreateBufferRegionARB", [(HDC, "hDC"), (Int, "iLayerPlane"), (UINT, "uType")]),
186     StdFunction(VOID, "wglDeleteBufferRegionARB", [(HANDLE, "hRegion")]),
187     StdFunction(BOOL, "wglSaveBufferRegionARB", [(HANDLE, "hRegion"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height")]),
188     StdFunction(BOOL, "wglRestoreBufferRegionARB", [(HANDLE, "hRegion"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height"), (Int, "xSrc"), (Int, "ySrc")]),
189
190     # WGL_ARB_extensions_string
191     StdFunction(ConstCString, "wglGetExtensionsStringARB", [(HDC, "hdc")], sideeffects=False),
192
193     # WGL_ARB_pixel_format
194     StdFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False),
195     StdFunction(BOOL, "wglGetPixelFormatAttribfvARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False),
196     StdFunction(BOOL, "wglChoosePixelFormatARB", [(HDC, "hdc"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribIList)"), "piAttribIList"), (Array(Const(FLOAT), "_AttribPairList_size(pfAttribFList)"), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "(*nNumFormats)"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]),
197
198     # WGL_ARB_make_current_read
199     StdFunction(BOOL, "wglMakeContextCurrentARB", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]),
200     StdFunction(HDC, "wglGetCurrentReadDCARB", [], sideeffects=False),
201
202     # WGL_ARB_pbuffer
203     StdFunction(HPBUFFERARB, "wglCreatePbufferARB", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribList)"), "piAttribList")]),
204     StdFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")]),
205     StdFunction(Int, "wglReleasePbufferDCARB", [(HPBUFFERARB, "hPbuffer"), (HDC, "hDC")]),
206     StdFunction(BOOL, "wglDestroyPbufferARB", [(HPBUFFERARB, "hPbuffer")]),
207     StdFunction(BOOL, "wglQueryPbufferARB", [(HPBUFFERARB, "hPbuffer"), (WGLenum, "iAttribute"), Out(Pointer(Int), "piValue")], sideeffects=False),
208
209     # WGL_ARB_render_texture
210     StdFunction(BOOL, "wglBindTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]),
211     StdFunction(BOOL, "wglReleaseTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]),
212     StdFunction(BOOL, "wglSetPbufferAttribARB", [(HPBUFFERARB, "hPbuffer"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribList)"), "piAttribList")]),
213
214     # WGL_ARB_create_context
215     StdFunction(HGLRC, "wglCreateContextAttribsARB", [(HDC, "hDC"), (HGLRC, "hShareContext"), (Array(Const(WGLenum), "_AttribPairList_size(attribList)"), "attribList")]),
216
217     # WGL_EXT_display_color_table
218     StdFunction(GLboolean, "wglCreateDisplayColorTableEXT", [(GLushort, "id")]),
219     StdFunction(GLboolean, "wglLoadDisplayColorTableEXT", [(Array(Const(GLushort), "length"), "table"), (GLuint, "length")]),
220     StdFunction(GLboolean, "wglBindDisplayColorTableEXT", [(GLushort, "id")]),
221     StdFunction(VOID, "wglDestroyDisplayColorTableEXT", [(GLushort, "id")]),
222
223     # WGL_EXT_extensions_string
224     StdFunction(ConstCString, "wglGetExtensionsStringEXT", [], sideeffects=False),
225
226     # WGL_EXT_make_current_read
227     StdFunction(BOOL, "wglMakeContextCurrentEXT", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]),
228     StdFunction(HDC, "wglGetCurrentReadDCEXT", [], sideeffects=False),
229
230     # WGL_EXT_pbuffer
231     StdFunction(HPBUFFEREXT, "wglCreatePbufferEXT", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribList)"), "piAttribList")]),
232     StdFunction(HDC, "wglGetPbufferDCEXT", [(HPBUFFEREXT, "hPbuffer")], sideeffects=False),
233     StdFunction(Int, "wglReleasePbufferDCEXT", [(HPBUFFEREXT, "hPbuffer"), (HDC, "hDC")]),
234     StdFunction(BOOL, "wglDestroyPbufferEXT", [(HPBUFFEREXT, "hPbuffer")]),
235     StdFunction(BOOL, "wglQueryPbufferEXT", [(HPBUFFEREXT, "hPbuffer"), (WGLenum, "iAttribute"), Out(Pointer(Int), "piValue")], sideeffects=False),
236
237     # WGL_EXT_pixel_format
238     StdFunction(BOOL, "wglGetPixelFormatAttribivEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False),
239     StdFunction(BOOL, "wglGetPixelFormatAttribfvEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False),
240     StdFunction(BOOL, "wglChoosePixelFormatEXT", [(HDC, "hdc"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribIList)"), "piAttribIList"), (Array(Const(FLOAT), "_AttribPairList_size(pfAttribFList)"), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "*nNumFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]),
241
242     # WGL_EXT_swap_control
243     StdFunction(BOOL, "wglSwapIntervalEXT", [(Int, "interval")]),
244     StdFunction(Int, "wglGetSwapIntervalEXT", [], sideeffects=False),
245
246     # WGL_NV_vertex_array_range
247     StdFunction(OpaquePointer(Void), "wglAllocateMemoryNV", [(GLsizei, "size"), (GLfloat, "readfreq"), (GLfloat, "writefreq"), (GLfloat, "priority")]),
248     StdFunction(Void, "wglFreeMemoryNV", [(OpaquePointer(Void), "pointer")]),
249
250     # WGL_OML_sync_control
251     StdFunction(BOOL, "wglGetSyncValuesOML", [(HDC, "hdc"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")], sideeffects=False),
252     StdFunction(BOOL, "wglGetMscRateOML", [(HDC, "hdc"), Out(Pointer(INT32), "numerator"), Out(Pointer(INT32), "denominator")], sideeffects=False),
253     StdFunction(INT64, "wglSwapBuffersMscOML", [(HDC, "hdc"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder")]),
254     StdFunction(INT64, "wglSwapLayerBuffersMscOML", [(HDC, "hdc"), (Int, "fuPlanes"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder")]),
255     StdFunction(BOOL, "wglWaitForMscOML", [(HDC, "hdc"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")]),
256     StdFunction(BOOL, "wglWaitForSbcOML", [(HDC, "hdc"), (INT64, "target_sbc"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")]),
257
258     # WGL_I3D_digital_video_control
259     StdFunction(BOOL, "wglGetDigitalVideoParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), Out(OpaqueArray(Int, "_wglGetDigitalVideoParametersI3D_size(iAttribute)"), "piValue")], sideeffects=False),
260     StdFunction(BOOL, "wglSetDigitalVideoParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), (OpaqueArray(Const(Int), "_wglSetDigitalVideoParametersI3D_size(iAttribute)"), "piValue")]),
261
262     # WGL_I3D_gamma
263     StdFunction(BOOL, "wglGetGammaTableParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), Out(OpaqueArray(Int, "_wglGetGammaTableParametersI3D_size(iAttribute)"), "piValue")], sideeffects=False),
264     StdFunction(BOOL, "wglSetGammaTableParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), (OpaqueArray(Const(Int), "_wglSetGammaTableParametersI3D_size(iAttribute)"), "piValue")]),
265     StdFunction(BOOL, "wglGetGammaTableI3D", [(HDC, "hDC"), (Int, "iEntries"), Out(Array(USHORT, "iEntries"), "puRed"), Out(Array(USHORT, "iEntries"), "puGreen"), Out(Array(USHORT, "iEntries"), "puBlue")], sideeffects=False),
266     StdFunction(BOOL, "wglSetGammaTableI3D", [(HDC, "hDC"), (Int, "iEntries"), (Array(Const(USHORT), "iEntries"), "puRed"), (Array(Const(USHORT), "iEntries"), "puGreen"), (Array(Const(USHORT), "iEntries"), "puBlue")]),
267
268     # WGL_I3D_genlock
269     StdFunction(BOOL, "wglEnableGenlockI3D", [(HDC, "hDC")]),
270     StdFunction(BOOL, "wglDisableGenlockI3D", [(HDC, "hDC")]),
271     StdFunction(BOOL, "wglIsEnabledGenlockI3D", [(HDC, "hDC"), Out(Pointer(BOOL), "pFlag")], sideeffects=False),
272     StdFunction(BOOL, "wglGenlockSourceI3D", [(HDC, "hDC"), (UINT, "uSource")]),
273     StdFunction(BOOL, "wglGetGenlockSourceI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uSource")], sideeffects=False),
274     StdFunction(BOOL, "wglGenlockSourceEdgeI3D", [(HDC, "hDC"), (UINT, "uEdge")]),
275     StdFunction(BOOL, "wglGetGenlockSourceEdgeI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uEdge")], sideeffects=False),
276     StdFunction(BOOL, "wglGenlockSampleRateI3D", [(HDC, "hDC"), (UINT, "uRate")]),
277     StdFunction(BOOL, "wglGetGenlockSampleRateI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uRate")], sideeffects=False),
278     StdFunction(BOOL, "wglGenlockSourceDelayI3D", [(HDC, "hDC"), (UINT, "uDelay")]),
279     StdFunction(BOOL, "wglGetGenlockSourceDelayI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uDelay")], sideeffects=False),
280     StdFunction(BOOL, "wglQueryGenlockMaxSourceDelayI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uMaxLineDelay"), Out(Pointer(UINT), "uMaxPixelDelay")]),
281
282     # WGL_I3D_image_buffer
283     StdFunction(LPVOID, "wglCreateImageBufferI3D", [(HDC, "hDC"), (DWORD, "dwSize"), (UINT, "uFlags")]),
284     StdFunction(BOOL, "wglDestroyImageBufferI3D", [(HDC, "hDC"), (LPVOID, "pAddress")]),
285     StdFunction(BOOL, "wglAssociateImageBufferEventsI3D", [(HDC, "hDC"), (Array(Const(HANDLE), "count"), "pEvent"), (Array(Const(LPVOID), "count"), "pAddress"), (Array(Const(DWORD), "count"), "pSize"), (UINT, "count")]),
286     StdFunction(BOOL, "wglReleaseImageBufferEventsI3D", [(HDC, "hDC"), (Array(Const(LPVOID), "count"), "pAddress"), (UINT, "count")]),
287
288     # WGL_I3D_swap_frame_lock
289     StdFunction(BOOL, "wglEnableFrameLockI3D", []),
290     StdFunction(BOOL, "wglDisableFrameLockI3D", []),
291     StdFunction(BOOL, "wglIsEnabledFrameLockI3D", [Out(Pointer(BOOL), "pFlag")], sideeffects=False),
292     StdFunction(BOOL, "wglQueryFrameLockMasterI3D", [Out(Pointer(BOOL), "pFlag")]),
293
294     # WGL_I3D_swap_frame_usage
295     StdFunction(BOOL, "wglGetFrameUsageI3D", [Out(Pointer(Float), "pUsage")], sideeffects=False),
296     StdFunction(BOOL, "wglBeginFrameTrackingI3D", []),
297     StdFunction(BOOL, "wglEndFrameTrackingI3D", []),
298     StdFunction(BOOL, "wglQueryFrameTrackingI3D", [Out(Pointer(DWORD), "pFrameCount"), Out(Pointer(DWORD), "pMissedFrames"), Out(Pointer(Float), "pLastMissedUsage")]),
299
300     # WGL_3DL_stereo_control
301     StdFunction(BOOL, "wglSetStereoEmitterState3DL", [(HDC, "hDC"), (UINT, "uState")]),
302
303     # WGL_NV_present_video
304     StdFunction(Int, "wglEnumerateVideoDevicesNV", [(HDC, "hDC"), Out(OpaquePointer(HVIDEOOUTPUTDEVICENV), "phDeviceList")]),
305     StdFunction(BOOL, "wglBindVideoDeviceNV", [(HDC, "hDC"), (UInt, "uVideoSlot"), (HVIDEOOUTPUTDEVICENV, "hVideoDevice"), (OpaqueArray(Const(Int), "_wglBindVideoDeviceNV_size()"), "piAttribList")]),
306     StdFunction(BOOL, "wglQueryCurrentContextNV", [(Int, "iAttribute"), Out(OpaqueArray(Int, "_wglQueryCurrentContextNV_size()"), "piValue")]),
307
308     # WGL_NV_video_output
309     StdFunction(BOOL, "wglGetVideoDeviceNV", [(HDC, "hDC"), (Int, "numDevices"), Out(Pointer(HPVIDEODEV), "hVideoDevice")], sideeffects=False),
310     StdFunction(BOOL, "wglReleaseVideoDeviceNV", [(HPVIDEODEV, "hVideoDevice")]),
311     StdFunction(BOOL, "wglBindVideoImageNV", [(HPVIDEODEV, "hVideoDevice"), (HPBUFFERARB, "hPbuffer"), (Int, "iVideoBuffer")]),
312     StdFunction(BOOL, "wglReleaseVideoImageNV", [(HPBUFFERARB, "hPbuffer"), (Int, "iVideoBuffer")]),
313     StdFunction(BOOL, "wglSendPbufferToVideoNV", [(HPBUFFERARB, "hPbuffer"), (Int, "iBufferType"), Out(Pointer(ULong), "pulCounterPbuffer"), (BOOL, "bBlock")]),
314     StdFunction(BOOL, "wglGetVideoInfoNV", [(HPVIDEODEV, "hpVideoDevice"), Out(Pointer(ULong), "pulCounterOutputPbuffer"), Out(Pointer(ULong), "pulCounterOutputVideo")], sideeffects=False),
315
316     # WGL_NV_swap_group
317     StdFunction(BOOL, "wglJoinSwapGroupNV", [(HDC, "hDC"), (GLuint, "group")]),
318     StdFunction(BOOL, "wglBindSwapBarrierNV", [(GLuint, "group"), (GLuint, "barrier")]),
319     StdFunction(BOOL, "wglQuerySwapGroupNV", [(HDC, "hDC"), Out(Pointer(GLuint), "group"), Out(Pointer(GLuint), "barrier")]),
320     StdFunction(BOOL, "wglQueryMaxSwapGroupsNV", [(HDC, "hDC"), Out(Pointer(GLuint), "maxGroups"), Out(Pointer(GLuint), "maxBarriers")]),
321     StdFunction(BOOL, "wglQueryFrameCountNV", [(HDC, "hDC"), Out(Pointer(GLuint), "count")]),
322     StdFunction(BOOL, "wglResetFrameCountNV", [(HDC, "hDC")]),
323
324     # WGL_NV_gpu_affinity
325     StdFunction(BOOL, "wglEnumGpusNV", [(UINT, "iGpuIndex"), Out(Pointer(HGPUNV), "phGpu")]),
326     StdFunction(BOOL, "wglEnumGpuDevicesNV", [(HGPUNV, "hGpu"), (UINT, "iDeviceIndex"), Out(Pointer(GPU_DEVICE), "lpGpuDevice")]),
327     StdFunction(HDC, "wglCreateAffinityDCNV", [(OpaqueArray(Const(HGPUNV), "_wglCreateAffinityDCNV_size()"), "phGpuList")]),
328     StdFunction(BOOL, "wglEnumGpusFromAffinityDCNV", [(HDC, "hAffinityDC"), (UINT, "iGpuIndex"), Out(Pointer(HGPUNV), "hGpu")]),
329     StdFunction(BOOL, "wglDeleteDCNV", [(HDC, "hdc")]),
330
331     # WGL_AMD_gpu_association
332     StdFunction(UINT, "wglGetGPUIDsAMD", [(UINT, "maxCount"), Out(Array(UINT, "maxCount"), "ids")], sideeffects=False),
333     StdFunction(INT, "wglGetGPUInfoAMD", [(UINT, "id"), (Int, "property"), (GLenum, "dataType"), (UINT, "size"), Out(OpaqueBlob(Void, "_wglGetGPUInfoAMD_size(dataType,size)"), "data")], sideeffects=False),
334     StdFunction(UINT, "wglGetContextGPUIDAMD", [(HGLRC, "hglrc")], sideeffects=False),
335     StdFunction(HGLRC, "wglCreateAssociatedContextAMD", [(UINT, "id")]),
336     StdFunction(HGLRC, "wglCreateAssociatedContextAttribsAMD", [(UINT, "id"), (HGLRC, "hShareContext"), (OpaqueArray(Const(Int), "_wglCreateAssociatedContextAttribsAMD_size()"), "attribList")]),
337     StdFunction(BOOL, "wglDeleteAssociatedContextAMD", [(HGLRC, "hglrc")]),
338     StdFunction(BOOL, "wglMakeAssociatedContextCurrentAMD", [(HGLRC, "hglrc")]),
339     StdFunction(HGLRC, "wglGetCurrentAssociatedContextAMD", [], sideeffects=False),
340     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")]),
341
342     # WGL_NV_video_capture
343     StdFunction(BOOL, "wglBindVideoCaptureDeviceNV", [(UINT, "uVideoSlot"), (HVIDEOINPUTDEVICENV, "hDevice")]),
344     StdFunction(UINT, "wglEnumerateVideoCaptureDevicesNV", [(HDC, "hDc"), Out(Pointer(HVIDEOINPUTDEVICENV), "phDeviceList")]),
345     StdFunction(BOOL, "wglLockVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice")]),
346     StdFunction(BOOL, "wglQueryVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice"), (Int, "iAttribute"), Out(Pointer(Int), "piValue")]),
347     StdFunction(BOOL, "wglReleaseVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice")]),
348
349     # WGL_NV_copy_image
350     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")]),
351
352     # WGL_NV_DX_interop
353     StdFunction(BOOL, "wglDXSetResourceShareHandleNV", [(OpaquePointer(Void), "dxObject"), (HANDLE, "shareHandle")]),
354     StdFunction(HANDLE, "wglDXOpenDeviceNV", [(OpaquePointer(Void), "dxDevice")]),
355     StdFunction(BOOL, "wglDXCloseDeviceNV", [(HANDLE, "hDevice")]),
356     StdFunction(HANDLE, "wglDXRegisterObjectNV", [(HANDLE, "hDevice"), (OpaquePointer(Void), "dxObject"), (GLuint, "name"), (GLenum, "type"), (GLenum, "access")]),
357     StdFunction(BOOL, "wglDXUnregisterObjectNV", [(HANDLE, "hDevice"), (HANDLE, "hObject")]),
358     StdFunction(BOOL, "wglDXObjectAccessNV", [(HANDLE, "hObject"), (GLenum, "access")]),
359     StdFunction(BOOL, "wglDXLockObjectsNV", [(HANDLE, "hDevice"), (GLint, "count"), Out(Array(HANDLE, "count"), "hObjects")]),
360     StdFunction(BOOL, "wglDXUnlockObjectsNV", [(HANDLE, "hDevice"), (GLint, "count"), Out(Array(HANDLE, "count"), "hObjects")]),
361
362     # must be last
363     StdFunction(PROC, "wglGetProcAddress", [(LPCSTR, "lpszProc")]),
364 ])