]> git.cworth.org Git - apitrace/blob - specs/wglapi.py
Merge branch 'attrib_list'
[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 WGLPixelFormatARBAttribsList = [
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_SHARE_DEPTH_ARB', BOOL),
160     ('WGL_SHARE_STENCIL_ARB', BOOL),
161     ('WGL_SHARE_ACCUM_ARB', BOOL),
162     ('WGL_SUPPORT_GDI_ARB', BOOL),
163     ('WGL_SUPPORT_OPENGL_ARB', BOOL),
164     ('WGL_DOUBLE_BUFFER_ARB', BOOL),
165     ('WGL_STEREO_ARB', BOOL),
166     ('WGL_PIXEL_TYPE_ARB', FakeEnum(Int, ['WGL_TYPE_RGBA_ARB', 'WGL_TYPE_COLORINDEX_ARB'])),
167     ('WGL_COLOR_BITS_ARB', Int),
168     ('WGL_RED_BITS_ARB', Int),
169     ('WGL_GREEN_BITS_ARB', Int),
170     ('WGL_BLUE_BITS_ARB', Int),
171     ('WGL_ALPHA_BITS_ARB', Int),
172     ('WGL_ACCUM_BITS_ARB', Int),
173     ('WGL_ACCUM_RED_BITS_ARB', Int),
174     ('WGL_ACCUM_GREEN_BITS_ARB', Int),
175     ('WGL_ACCUM_BLUE_BITS_ARB', Int),
176     ('WGL_ACCUM_ALPHA_BITS_ARB', Int),
177     ('WGL_DEPTH_BITS_ARB', Int),
178     ('WGL_STENCIL_BITS_ARB', Int),
179     ('WGL_AUX_BUFFERS_ARB', Int)
180 ]
181
182 WGLPixelFormatARBAttribs = AttribArray(WGLenum, WGLPixelFormatARBAttribsList)
183 WGLPixelFormatARBFloatAttribs = AttribArray(WGLenum, WGLPixelFormatARBAttribsList, punType = FLOAT)
184
185 WGLPixelFormatEXTAttribsList = [
186 #    ('WGL_NUMBER_PIXEL_FORMATS_EXT', Int), # not in ...ARB # only allowed in wglGetPixelFormatAttribiv
187     ('WGL_DRAW_TO_WINDOW_ARB', BOOL),
188     ('WGL_DRAW_TO_BITMAP_ARB', BOOL),
189     ('WGL_ACCELERATION_ARB', FakeEnum(Int, ['WGL_NO_ACCELERATION_ARB', 'WGL_GENERIC_ACCELERATION_ARB', 'WGL_FULL_ACCELERATION_ARB'])),
190     ('WGL_NEED_PALETTE_ARB', BOOL),
191     ('WGL_NEED_SYSTEM_PALETTE_ARB', BOOL),
192     ('WGL_SWAP_LAYER_BUFFERS_ARB', BOOL),
193     ('WGL_SWAP_METHOD_ARB', FakeEnum(Int, ['WGL_SWAP_EXCHANGE_ARB', 'WGL_SWAP_COPY_ARB', 'WGL_SWAP_UNDEFINED_ARB'])),
194     ('WGL_NUMBER_OVERLAYS_ARB', Int),
195     ('WGL_NUMBER_UNDERLAYS_ARB', Int),
196     ('WGL_TRANSPARENT_EXT', BOOL), # not in ...ARB
197     ('WGL_TRANSPARENT_VALUE_EXT', Int), # not in ...ARB
198     ('WGL_SHARE_DEPTH_ARB', BOOL),
199     ('WGL_SHARE_STENCIL_ARB', BOOL),
200     ('WGL_SHARE_ACCUM_ARB', BOOL),
201     ('WGL_SUPPORT_GDI_ARB', BOOL),
202     ('WGL_SUPPORT_OPENGL_ARB', BOOL),
203     ('WGL_DOUBLE_BUFFER_ARB', BOOL),
204     ('WGL_STEREO_ARB', BOOL),
205     ('WGL_PIXEL_TYPE_ARB', FakeEnum(Int, ['WGL_TYPE_RGBA_ARB', 'WGL_TYPE_COLORINDEX_ARB'])),
206     ('WGL_COLOR_BITS_ARB', Int),
207     ('WGL_RED_BITS_ARB', Int),
208     ('WGL_RED_SHIFT_EXT', Int), # not in ...ARB
209     ('WGL_GREEN_BITS_ARB', Int),
210     ('WGL_GREEN_SHIFT_EXT', Int), # not in ...ARB
211     ('WGL_BLUE_BITS_ARB', Int),
212     ('WGL_BLUE_SHIFT_EXT', Int), # not in ...ARB
213     ('WGL_ALPHA_BITS_ARB', Int),
214     ('WGL_ALPHA_SHIFT_EXT', Int), # not in ...ARB
215     ('WGL_ACCUM_BITS_ARB', Int),
216     ('WGL_ACCUM_RED_BITS_ARB', Int),
217     ('WGL_ACCUM_GREEN_BITS_ARB', Int),
218     ('WGL_ACCUM_BLUE_BITS_ARB', Int),
219     ('WGL_ACCUM_ALPHA_BITS_ARB', Int),
220     ('WGL_DEPTH_BITS_ARB', Int),
221     ('WGL_STENCIL_BITS_ARB', Int),
222     ('WGL_AUX_BUFFERS_ARB', Int)
223 ]
224
225 WGLPixelFormatEXTAttribs = AttribArray(WGLenum, WGLPixelFormatEXTAttribsList)
226 WGLPixelFormatEXTFloatAttribs = AttribArray(WGLenum, WGLPixelFormatEXTAttribsList, punType = FLOAT)
227
228 WGLCreatePbufferARBAttribs = AttribArray(WGLenum, [
229     ('WGL_PBUFFER_LARGEST_ARB', Int)
230 ])
231
232 CubeFaceEnum = FakeEnum(Int, [
233     'WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB',
234     'WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB',
235     'WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB',
236     'WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB',
237     'WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB',
238     'WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB'
239 ])
240
241 WGLSetPbufferARBAttribs = AttribArray(WGLenum, [
242     ('WGL_MIPMAP_LEVEL_ARB', Int),
243     ('WGL_CUBE_MAP_FACE_ARB', CubeFaceEnum)
244 ])
245
246 HPBUFFERARB = Alias("HPBUFFERARB", HANDLE)
247 HPBUFFEREXT = Alias("HPBUFFEREXT", HANDLE)
248 HPVIDEODEV = Alias("HPVIDEODEV", HANDLE)
249 HVIDEOOUTPUTDEVICENV = Alias("HVIDEOOUTPUTDEVICENV", HANDLE)
250 HVIDEOINPUTDEVICENV = Alias("HVIDEOINPUTDEVICENV", HANDLE)
251 HGPUNV = Alias("HGPUNV", HANDLE)
252
253 GPU_DEVICE = Struct("GPU_DEVICE", [
254     (DWORD, "cb"),
255     (CString, "DeviceName"),
256     (CString, "DeviceString"),
257     (DWORD, "Flags"),
258     (RECT, "rcVirtualScreen"),
259 ])
260
261
262 wglapi.addFunctions([
263     # WGL
264     StdFunction(HGLRC, "wglCreateContext", [(HDC, "hdc")]),
265     StdFunction(BOOL, "wglDeleteContext", [(HGLRC, "hglrc")]),
266     StdFunction(HGLRC, "wglGetCurrentContext", [], sideeffects=False),
267     StdFunction(BOOL, "wglMakeCurrent", [(HDC, "hdc"), (HGLRC, "hglrc")]),
268     StdFunction(BOOL, "wglCopyContext", [(HGLRC, "hglrcSrc"), (HGLRC, "hglrcDst"), (UINT, "mask")]),
269     StdFunction(Int, "wglChoosePixelFormat", [(HDC, "hdc"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]), 
270     StdFunction(Int, "wglDescribePixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (UINT, "nBytes"), Out(Pointer(PIXELFORMATDESCRIPTOR), "ppfd")]),
271     StdFunction(HDC, "wglGetCurrentDC", [], sideeffects=False),
272     StdFunction(PROC, "wglGetDefaultProcAddress", [(LPCSTR, "lpszProc")], sideeffects=False),
273     StdFunction(Int, "wglGetPixelFormat", [(HDC, "hdc")], sideeffects=False),
274     StdFunction(BOOL, "wglSetPixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]),
275     StdFunction(BOOL, "wglSwapBuffers", [(HDC, "hdc")]),
276     StdFunction(BOOL, "wglShareLists", [(HGLRC, "hglrc1"), (HGLRC, "hglrc2")]),
277     StdFunction(HGLRC, "wglCreateLayerContext", [(HDC, "hdc"), (Int, "iLayerPlane")]),
278     StdFunction(BOOL, "wglDescribeLayerPlane", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nBytes"), Out(Pointer(LAYERPLANEDESCRIPTOR), "plpd")]),
279     StdFunction(Int, "wglSetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), (Array(Const(COLORREF), "cEntries"), "pcr")]),
280     StdFunction(Int, "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), Out(Array(COLORREF, "cEntries"), "pcr")], sideeffects=False),
281     StdFunction(BOOL, "wglRealizeLayerPalette", [(HDC, "hdc"), (Int, "iLayerPlane"), (BOOL, "bRealize")]),
282     StdFunction(BOOL, "wglSwapLayerBuffers", [(HDC, "hdc"), (UINT, "fuPlanes")]),
283     StdFunction(BOOL, "wglUseFontBitmapsA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]),
284     StdFunction(BOOL, "wglUseFontBitmapsW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]),
285     StdFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Array(Const(WGLSWAP), "n"), "ps")]),
286     StdFunction(BOOL, "wglUseFontOutlinesA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]),
287     StdFunction(BOOL, "wglUseFontOutlinesW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]),
288
289     # WGL_ARB_buffer_region
290     StdFunction(HANDLE, "wglCreateBufferRegionARB", [(HDC, "hDC"), (Int, "iLayerPlane"), (UINT, "uType")]),
291     StdFunction(VOID, "wglDeleteBufferRegionARB", [(HANDLE, "hRegion")]),
292     StdFunction(BOOL, "wglSaveBufferRegionARB", [(HANDLE, "hRegion"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height")]),
293     StdFunction(BOOL, "wglRestoreBufferRegionARB", [(HANDLE, "hRegion"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height"), (Int, "xSrc"), (Int, "ySrc")]),
294
295     # WGL_ARB_extensions_string
296     StdFunction(ConstCString, "wglGetExtensionsStringARB", [(HDC, "hdc")], sideeffects=False),
297
298     # WGL_ARB_pixel_format
299     StdFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False),
300     StdFunction(BOOL, "wglGetPixelFormatAttribfvARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False),
301     StdFunction(BOOL, "wglChoosePixelFormatARB", [(HDC, "hdc"), (WGLPixelFormatARBAttribs, "piAttribIList"), (WGLPixelFormatARBFloatAttribs, "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "(*nNumFormats)"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]),
302
303     # WGL_ARB_make_current_read
304     StdFunction(BOOL, "wglMakeContextCurrentARB", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]),
305     StdFunction(HDC, "wglGetCurrentReadDCARB", [], sideeffects=False),
306
307     # WGL_ARB_pbuffer
308     StdFunction(HPBUFFERARB, "wglCreatePbufferARB", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (WGLCreatePbufferARBAttribs, "piAttribList")]),
309     StdFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")]),
310     StdFunction(Int, "wglReleasePbufferDCARB", [(HPBUFFERARB, "hPbuffer"), (HDC, "hDC")]),
311     StdFunction(BOOL, "wglDestroyPbufferARB", [(HPBUFFERARB, "hPbuffer")]),
312     StdFunction(BOOL, "wglQueryPbufferARB", [(HPBUFFERARB, "hPbuffer"), (WGLenum, "iAttribute"), Out(Pointer(Int), "piValue")], sideeffects=False),
313
314     # WGL_ARB_render_texture
315     StdFunction(BOOL, "wglBindTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]),
316     StdFunction(BOOL, "wglReleaseTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]),
317     StdFunction(BOOL, "wglSetPbufferAttribARB", [(HPBUFFERARB, "hPbuffer"), (WGLSetPbufferARBAttribs, "piAttribList")]),
318
319     # WGL_ARB_create_context
320     StdFunction(HGLRC, "wglCreateContextAttribsARB", [(HDC, "hDC"), (HGLRC, "hShareContext"), (WGLContextAttribs, "attribList")]),
321
322     # WGL_EXT_display_color_table
323     StdFunction(GLboolean, "wglCreateDisplayColorTableEXT", [(GLushort, "id")]),
324     StdFunction(GLboolean, "wglLoadDisplayColorTableEXT", [(Array(Const(GLushort), "length"), "table"), (GLuint, "length")]),
325     StdFunction(GLboolean, "wglBindDisplayColorTableEXT", [(GLushort, "id")]),
326     StdFunction(VOID, "wglDestroyDisplayColorTableEXT", [(GLushort, "id")]),
327
328     # WGL_EXT_extensions_string
329     StdFunction(ConstCString, "wglGetExtensionsStringEXT", [], sideeffects=False),
330
331     # WGL_EXT_make_current_read
332     StdFunction(BOOL, "wglMakeContextCurrentEXT", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]),
333     StdFunction(HDC, "wglGetCurrentReadDCEXT", [], sideeffects=False),
334
335     # WGL_EXT_pbuffer
336     StdFunction(HPBUFFEREXT, "wglCreatePbufferEXT", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (WGLCreatePbufferARBAttribs, "piAttribList")]),
337     StdFunction(HDC, "wglGetPbufferDCEXT", [(HPBUFFEREXT, "hPbuffer")], sideeffects=False),
338     StdFunction(Int, "wglReleasePbufferDCEXT", [(HPBUFFEREXT, "hPbuffer"), (HDC, "hDC")]),
339     StdFunction(BOOL, "wglDestroyPbufferEXT", [(HPBUFFEREXT, "hPbuffer")]),
340     StdFunction(BOOL, "wglQueryPbufferEXT", [(HPBUFFEREXT, "hPbuffer"), (WGLenum, "iAttribute"), Out(Pointer(Int), "piValue")], sideeffects=False),
341
342     # WGL_EXT_pixel_format
343     StdFunction(BOOL, "wglGetPixelFormatAttribivEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False),
344     StdFunction(BOOL, "wglGetPixelFormatAttribfvEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False),
345     StdFunction(BOOL, "wglChoosePixelFormatEXT", [(HDC, "hdc"), (WGLPixelFormatEXTAttribs, "piAttribIList"), (WGLPixelFormatEXTFloatAttribs, "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "*nNumFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]),
346
347     # WGL_EXT_swap_control
348     StdFunction(BOOL, "wglSwapIntervalEXT", [(Int, "interval")]),
349     StdFunction(Int, "wglGetSwapIntervalEXT", [], sideeffects=False),
350
351     # WGL_NV_vertex_array_range
352     StdFunction(OpaquePointer(Void), "wglAllocateMemoryNV", [(GLsizei, "size"), (GLfloat, "readfreq"), (GLfloat, "writefreq"), (GLfloat, "priority")]),
353     StdFunction(Void, "wglFreeMemoryNV", [(OpaquePointer(Void), "pointer")]),
354
355     # WGL_OML_sync_control
356     StdFunction(BOOL, "wglGetSyncValuesOML", [(HDC, "hdc"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")], sideeffects=False),
357     StdFunction(BOOL, "wglGetMscRateOML", [(HDC, "hdc"), Out(Pointer(INT32), "numerator"), Out(Pointer(INT32), "denominator")], sideeffects=False),
358     StdFunction(INT64, "wglSwapBuffersMscOML", [(HDC, "hdc"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder")]),
359     StdFunction(INT64, "wglSwapLayerBuffersMscOML", [(HDC, "hdc"), (Int, "fuPlanes"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder")]),
360     StdFunction(BOOL, "wglWaitForMscOML", [(HDC, "hdc"), (INT64, "target_msc"), (INT64, "divisor"), (INT64, "remainder"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")]),
361     StdFunction(BOOL, "wglWaitForSbcOML", [(HDC, "hdc"), (INT64, "target_sbc"), Out(Pointer(INT64), "ust"), Out(Pointer(INT64), "msc"), Out(Pointer(INT64), "sbc")]),
362
363     # WGL_I3D_digital_video_control
364     StdFunction(BOOL, "wglGetDigitalVideoParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), Out(OpaqueArray(Int, "_wglGetDigitalVideoParametersI3D_size(iAttribute)"), "piValue")], sideeffects=False),
365     StdFunction(BOOL, "wglSetDigitalVideoParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), (OpaqueArray(Const(Int), "_wglSetDigitalVideoParametersI3D_size(iAttribute)"), "piValue")]),
366
367     # WGL_I3D_gamma
368     StdFunction(BOOL, "wglGetGammaTableParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), Out(OpaqueArray(Int, "_wglGetGammaTableParametersI3D_size(iAttribute)"), "piValue")], sideeffects=False),
369     StdFunction(BOOL, "wglSetGammaTableParametersI3D", [(HDC, "hDC"), (Int, "iAttribute"), (OpaqueArray(Const(Int), "_wglSetGammaTableParametersI3D_size(iAttribute)"), "piValue")]),
370     StdFunction(BOOL, "wglGetGammaTableI3D", [(HDC, "hDC"), (Int, "iEntries"), Out(Array(USHORT, "iEntries"), "puRed"), Out(Array(USHORT, "iEntries"), "puGreen"), Out(Array(USHORT, "iEntries"), "puBlue")], sideeffects=False),
371     StdFunction(BOOL, "wglSetGammaTableI3D", [(HDC, "hDC"), (Int, "iEntries"), (Array(Const(USHORT), "iEntries"), "puRed"), (Array(Const(USHORT), "iEntries"), "puGreen"), (Array(Const(USHORT), "iEntries"), "puBlue")]),
372
373     # WGL_I3D_genlock
374     StdFunction(BOOL, "wglEnableGenlockI3D", [(HDC, "hDC")]),
375     StdFunction(BOOL, "wglDisableGenlockI3D", [(HDC, "hDC")]),
376     StdFunction(BOOL, "wglIsEnabledGenlockI3D", [(HDC, "hDC"), Out(Pointer(BOOL), "pFlag")], sideeffects=False),
377     StdFunction(BOOL, "wglGenlockSourceI3D", [(HDC, "hDC"), (UINT, "uSource")]),
378     StdFunction(BOOL, "wglGetGenlockSourceI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uSource")], sideeffects=False),
379     StdFunction(BOOL, "wglGenlockSourceEdgeI3D", [(HDC, "hDC"), (UINT, "uEdge")]),
380     StdFunction(BOOL, "wglGetGenlockSourceEdgeI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uEdge")], sideeffects=False),
381     StdFunction(BOOL, "wglGenlockSampleRateI3D", [(HDC, "hDC"), (UINT, "uRate")]),
382     StdFunction(BOOL, "wglGetGenlockSampleRateI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uRate")], sideeffects=False),
383     StdFunction(BOOL, "wglGenlockSourceDelayI3D", [(HDC, "hDC"), (UINT, "uDelay")]),
384     StdFunction(BOOL, "wglGetGenlockSourceDelayI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uDelay")], sideeffects=False),
385     StdFunction(BOOL, "wglQueryGenlockMaxSourceDelayI3D", [(HDC, "hDC"), Out(Pointer(UINT), "uMaxLineDelay"), Out(Pointer(UINT), "uMaxPixelDelay")]),
386
387     # WGL_I3D_image_buffer
388     StdFunction(LPVOID, "wglCreateImageBufferI3D", [(HDC, "hDC"), (DWORD, "dwSize"), (UINT, "uFlags")]),
389     StdFunction(BOOL, "wglDestroyImageBufferI3D", [(HDC, "hDC"), (LPVOID, "pAddress")]),
390     StdFunction(BOOL, "wglAssociateImageBufferEventsI3D", [(HDC, "hDC"), (Array(Const(HANDLE), "count"), "pEvent"), (Array(Const(LPVOID), "count"), "pAddress"), (Array(Const(DWORD), "count"), "pSize"), (UINT, "count")]),
391     StdFunction(BOOL, "wglReleaseImageBufferEventsI3D", [(HDC, "hDC"), (Array(Const(LPVOID), "count"), "pAddress"), (UINT, "count")]),
392
393     # WGL_I3D_swap_frame_lock
394     StdFunction(BOOL, "wglEnableFrameLockI3D", []),
395     StdFunction(BOOL, "wglDisableFrameLockI3D", []),
396     StdFunction(BOOL, "wglIsEnabledFrameLockI3D", [Out(Pointer(BOOL), "pFlag")], sideeffects=False),
397     StdFunction(BOOL, "wglQueryFrameLockMasterI3D", [Out(Pointer(BOOL), "pFlag")]),
398
399     # WGL_I3D_swap_frame_usage
400     StdFunction(BOOL, "wglGetFrameUsageI3D", [Out(Pointer(Float), "pUsage")], sideeffects=False),
401     StdFunction(BOOL, "wglBeginFrameTrackingI3D", []),
402     StdFunction(BOOL, "wglEndFrameTrackingI3D", []),
403     StdFunction(BOOL, "wglQueryFrameTrackingI3D", [Out(Pointer(DWORD), "pFrameCount"), Out(Pointer(DWORD), "pMissedFrames"), Out(Pointer(Float), "pLastMissedUsage")]),
404
405     # WGL_3DL_stereo_control
406     StdFunction(BOOL, "wglSetStereoEmitterState3DL", [(HDC, "hDC"), (UINT, "uState")]),
407
408     # WGL_NV_present_video
409     StdFunction(Int, "wglEnumerateVideoDevicesNV", [(HDC, "hDC"), Out(OpaquePointer(HVIDEOOUTPUTDEVICENV), "phDeviceList")]),
410     StdFunction(BOOL, "wglBindVideoDeviceNV", [(HDC, "hDC"), (UInt, "uVideoSlot"), (HVIDEOOUTPUTDEVICENV, "hVideoDevice"), (OpaqueArray(Const(Int), "_wglBindVideoDeviceNV_size()"), "piAttribList")]),
411     StdFunction(BOOL, "wglQueryCurrentContextNV", [(Int, "iAttribute"), Out(OpaqueArray(Int, "_wglQueryCurrentContextNV_size()"), "piValue")]),
412
413     # WGL_NV_video_output
414     StdFunction(BOOL, "wglGetVideoDeviceNV", [(HDC, "hDC"), (Int, "numDevices"), Out(Pointer(HPVIDEODEV), "hVideoDevice")], sideeffects=False),
415     StdFunction(BOOL, "wglReleaseVideoDeviceNV", [(HPVIDEODEV, "hVideoDevice")]),
416     StdFunction(BOOL, "wglBindVideoImageNV", [(HPVIDEODEV, "hVideoDevice"), (HPBUFFERARB, "hPbuffer"), (Int, "iVideoBuffer")]),
417     StdFunction(BOOL, "wglReleaseVideoImageNV", [(HPBUFFERARB, "hPbuffer"), (Int, "iVideoBuffer")]),
418     StdFunction(BOOL, "wglSendPbufferToVideoNV", [(HPBUFFERARB, "hPbuffer"), (Int, "iBufferType"), Out(Pointer(ULong), "pulCounterPbuffer"), (BOOL, "bBlock")]),
419     StdFunction(BOOL, "wglGetVideoInfoNV", [(HPVIDEODEV, "hpVideoDevice"), Out(Pointer(ULong), "pulCounterOutputPbuffer"), Out(Pointer(ULong), "pulCounterOutputVideo")], sideeffects=False),
420
421     # WGL_NV_swap_group
422     StdFunction(BOOL, "wglJoinSwapGroupNV", [(HDC, "hDC"), (GLuint, "group")]),
423     StdFunction(BOOL, "wglBindSwapBarrierNV", [(GLuint, "group"), (GLuint, "barrier")]),
424     StdFunction(BOOL, "wglQuerySwapGroupNV", [(HDC, "hDC"), Out(Pointer(GLuint), "group"), Out(Pointer(GLuint), "barrier")]),
425     StdFunction(BOOL, "wglQueryMaxSwapGroupsNV", [(HDC, "hDC"), Out(Pointer(GLuint), "maxGroups"), Out(Pointer(GLuint), "maxBarriers")]),
426     StdFunction(BOOL, "wglQueryFrameCountNV", [(HDC, "hDC"), Out(Pointer(GLuint), "count")]),
427     StdFunction(BOOL, "wglResetFrameCountNV", [(HDC, "hDC")]),
428
429     # WGL_NV_gpu_affinity
430     StdFunction(BOOL, "wglEnumGpusNV", [(UINT, "iGpuIndex"), Out(Pointer(HGPUNV), "phGpu")]),
431     StdFunction(BOOL, "wglEnumGpuDevicesNV", [(HGPUNV, "hGpu"), (UINT, "iDeviceIndex"), Out(Pointer(GPU_DEVICE), "lpGpuDevice")]),
432     StdFunction(HDC, "wglCreateAffinityDCNV", [(OpaqueArray(Const(HGPUNV), "_wglCreateAffinityDCNV_size()"), "phGpuList")]),
433     StdFunction(BOOL, "wglEnumGpusFromAffinityDCNV", [(HDC, "hAffinityDC"), (UINT, "iGpuIndex"), Out(Pointer(HGPUNV), "hGpu")]),
434     StdFunction(BOOL, "wglDeleteDCNV", [(HDC, "hdc")]),
435
436     # WGL_AMD_gpu_association
437     StdFunction(UINT, "wglGetGPUIDsAMD", [(UINT, "maxCount"), Out(Array(UINT, "maxCount"), "ids")], sideeffects=False),
438     StdFunction(INT, "wglGetGPUInfoAMD", [(UINT, "id"), (Int, "property"), (GLenum, "dataType"), (UINT, "size"), Out(OpaqueBlob(Void, "_wglGetGPUInfoAMD_size(dataType,size)"), "data")], sideeffects=False),
439     StdFunction(UINT, "wglGetContextGPUIDAMD", [(HGLRC, "hglrc")], sideeffects=False),
440     StdFunction(HGLRC, "wglCreateAssociatedContextAMD", [(UINT, "id")]),
441     StdFunction(HGLRC, "wglCreateAssociatedContextAttribsAMD", [(UINT, "id"), (HGLRC, "hShareContext"), (OpaqueArray(Const(Int), "_wglCreateAssociatedContextAttribsAMD_size()"), "attribList")]),
442     StdFunction(BOOL, "wglDeleteAssociatedContextAMD", [(HGLRC, "hglrc")]),
443     StdFunction(BOOL, "wglMakeAssociatedContextCurrentAMD", [(HGLRC, "hglrc")]),
444     StdFunction(HGLRC, "wglGetCurrentAssociatedContextAMD", [], sideeffects=False),
445     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")]),
446
447     # WGL_NV_video_capture
448     StdFunction(BOOL, "wglBindVideoCaptureDeviceNV", [(UINT, "uVideoSlot"), (HVIDEOINPUTDEVICENV, "hDevice")]),
449     StdFunction(UINT, "wglEnumerateVideoCaptureDevicesNV", [(HDC, "hDc"), Out(Pointer(HVIDEOINPUTDEVICENV), "phDeviceList")]),
450     StdFunction(BOOL, "wglLockVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice")]),
451     StdFunction(BOOL, "wglQueryVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice"), (Int, "iAttribute"), Out(Pointer(Int), "piValue")]),
452     StdFunction(BOOL, "wglReleaseVideoCaptureDeviceNV", [(HDC, "hDc"), (HVIDEOINPUTDEVICENV, "hDevice")]),
453
454     # WGL_NV_copy_image
455     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")]),
456
457     # WGL_NV_DX_interop
458     StdFunction(BOOL, "wglDXSetResourceShareHandleNV", [(OpaquePointer(Void), "dxObject"), (HANDLE, "shareHandle")]),
459     StdFunction(HANDLE, "wglDXOpenDeviceNV", [(OpaquePointer(Void), "dxDevice")]),
460     StdFunction(BOOL, "wglDXCloseDeviceNV", [(HANDLE, "hDevice")]),
461     StdFunction(HANDLE, "wglDXRegisterObjectNV", [(HANDLE, "hDevice"), (OpaquePointer(Void), "dxObject"), (GLuint, "name"), (GLenum, "type"), (GLenum, "access")]),
462     StdFunction(BOOL, "wglDXUnregisterObjectNV", [(HANDLE, "hDevice"), (HANDLE, "hObject")]),
463     StdFunction(BOOL, "wglDXObjectAccessNV", [(HANDLE, "hObject"), (GLenum, "access")]),
464     StdFunction(BOOL, "wglDXLockObjectsNV", [(HANDLE, "hDevice"), (GLint, "count"), Out(Array(HANDLE, "count"), "hObjects")]),
465     StdFunction(BOOL, "wglDXUnlockObjectsNV", [(HANDLE, "hDevice"), (GLint, "count"), Out(Array(HANDLE, "count"), "hObjects")]),
466
467     # must be last
468     StdFunction(PROC, "wglGetProcAddress", [(LPCSTR, "lpszProc")]),
469 ])