blob: e9fa7bde31c271cd14ac2022ba52536191751538 [file] [log] [blame]
José Fonseca99771fc2010-11-25 20:32:59 +00001##########################################################################
2#
3# Copyright 2008-2009 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
José Fonseca4a826ed2010-11-30 16:58:22 +000026"""GLX API description."""
27
José Fonseca99771fc2010-11-25 20:32:59 +000028
29from stdapi import *
José Fonseca8d1f7272011-06-09 00:27:27 +010030from glapi import *
José Fonseca99771fc2010-11-25 20:32:59 +000031
José Fonsecae90885a2010-11-26 15:01:18 +000032VisualID = Alias("VisualID", UInt32)
José Fonsecae90885a2010-11-26 15:01:18 +000033Display = Opaque("Display *")
34Visual = Opaque("Visual *")
Zack Rusinf3f2e462011-03-23 18:35:39 -040035Font = Alias("Font", UInt32)
36Pixmap = Alias("Pixmap", UInt32)
37Window = Alias("Window", UInt32)
José Fonseca917329e2011-10-19 17:28:49 +020038Colormap = Alias("Colormap", UInt32)
Zack Rusinf3f2e462011-03-23 18:35:39 -040039
40GLXContext = Opaque("GLXContext")
41GLXPixmap = Alias("GLXPixmap", UInt32)
42GLXDrawable = Alias("GLXDrawable", UInt32)
43GLXFBConfig = Opaque("GLXFBConfig")
José Fonseca8d1f7272011-06-09 00:27:27 +010044GLXFBConfigSGIX = Opaque("GLXFBConfigSGIX")
Zack Rusinf3f2e462011-03-23 18:35:39 -040045GLXFBConfigID = Alias("GLXFBConfigID", UInt32)
46GLXContextID = Alias("GLXContextID", UInt32)
47GLXWindow = Alias("GLXWindow", UInt32)
48GLXPbuffer = Alias("GLXPbuffer", UInt32)
José Fonseca8d1f7272011-06-09 00:27:27 +010049GLXPbufferSGIX = Alias("GLXPbufferSGIX", UInt32)
50GLXVideoSourceSGIX = Alias("GLXVideoSourceSGIX", UInt32)
José Fonsecae90885a2010-11-26 15:01:18 +000051
52XVisualInfo = Struct("XVisualInfo", [
53 (Visual, "visual"),
54 (VisualID, "visualid"),
55 (Int, "screen"),
56 (Int, "depth"),
57 (Int, "c_class"),
58 (ULong, "red_mask"),
59 (ULong, "green_mask"),
60 (ULong, "blue_mask"),
61 (Int, "colormap_size"),
62 (Int, "bits_per_rgb"),
63])
64
José Fonseca8d1f7272011-06-09 00:27:27 +010065Bool = FakeEnum(Int, [
José Fonseca0d4ef5b2011-03-27 12:45:40 +010066 "False",
67 "True",
68])
69
José Fonseca1fcc39c2013-05-10 08:26:51 +010070GLXEnum = FakeEnum(Int, [
José Fonsecaecbfc9f2011-10-09 14:50:24 +010071 #"GLX_USE_GL", # 1
72 "GLX_BUFFER_SIZE", # 2
73 "GLX_LEVEL", # 3
74 "GLX_RGBA", # 4
75 "GLX_DOUBLEBUFFER", # 5
76 "GLX_STEREO", # 6
77 "GLX_AUX_BUFFERS", # 7
78 "GLX_RED_SIZE", # 8
79 "GLX_GREEN_SIZE", # 9
80 "GLX_BLUE_SIZE", # 10
81 "GLX_ALPHA_SIZE", # 11
82 "GLX_DEPTH_SIZE", # 12
83 "GLX_STENCIL_SIZE", # 13
84 "GLX_ACCUM_RED_SIZE", # 14
85 "GLX_ACCUM_GREEN_SIZE", # 15
86 "GLX_ACCUM_BLUE_SIZE", # 16
87 "GLX_ACCUM_ALPHA_SIZE", # 17
José Fonsecaafffa742011-05-09 23:43:39 +010088
89 "GLX_CONFIG_CAVEAT", # 0x20
90 "GLX_X_VISUAL_TYPE", # 0x22
91 "GLX_TRANSPARENT_TYPE", # 0x23
92 "GLX_TRANSPARENT_INDEX_VALUE", # 0x24
93 "GLX_TRANSPARENT_RED_VALUE", # 0x25
94 "GLX_TRANSPARENT_GREEN_VALUE", # 0x26
95 "GLX_TRANSPARENT_BLUE_VALUE", # 0x27
96 "GLX_TRANSPARENT_ALPHA_VALUE", # 0x28
97
José Fonsecaecbfc9f2011-10-09 14:50:24 +010098 "GLX_CONTEXT_MAJOR_VERSION_ARB", # 0x2091
99 "GLX_CONTEXT_MINOR_VERSION_ARB", # 0x2092
100 "GLX_CONTEXT_FLAGS_ARB", # 0x2094
101
José Fonseca5a76ccf2011-06-03 19:34:55 +0100102 "GLX_BIND_TO_TEXTURE_RGB_EXT", # 0x20D0
103 "GLX_BIND_TO_TEXTURE_RGBA_EXT", # 0x20D1
104 "GLX_BIND_TO_MIPMAP_TEXTURE_EXT", # 0x20D2
105 "GLX_BIND_TO_TEXTURE_TARGETS_EXT", # 0x20D3
106 "GLX_Y_INVERTED_EXT", # 0x20D4
107 "GLX_TEXTURE_FORMAT_EXT", # 0x20D5
108 "GLX_TEXTURE_TARGET_EXT", # 0x20D6
109 "GLX_MIPMAP_TEXTURE_EXT", # 0x20D7
110 "GLX_TEXTURE_FORMAT_NONE_EXT", # 0x20D8
111 "GLX_TEXTURE_FORMAT_RGB_EXT", # 0x20D9
112 "GLX_TEXTURE_FORMAT_RGBA_EXT", # 0x20DA
113 "GLX_TEXTURE_1D_EXT", # 0x20DB
114 "GLX_TEXTURE_2D_EXT", # 0x20DC
115 "GLX_TEXTURE_RECTANGLE_EXT", # 0x20DD
116 "GLX_FRONT_LEFT_EXT", # 0x20DE
117 "GLX_FRONT_RIGHT_EXT", # 0x20DF
118 "GLX_BACK_LEFT_EXT", # 0x20E0
119 "GLX_BACK_RIGHT_EXT", # 0x20E1
120 "GLX_AUX0_EXT", # 0x20E2
121 "GLX_AUX1_EXT", # 0x20E3
122 "GLX_AUX2_EXT", # 0x20E4
123 "GLX_AUX3_EXT", # 0x20E5
124 "GLX_AUX4_EXT", # 0x20E6
125 "GLX_AUX5_EXT", # 0x20E7
126 "GLX_AUX6_EXT", # 0x20E8
127 "GLX_AUX7_EXT", # 0x20E9
128 "GLX_AUX8_EXT", # 0x20EA
129 "GLX_AUX9_EXT", # 0x20EB
130
José Fonsecaafffa742011-05-09 23:43:39 +0100131 "GLX_NONE", # 0x8000
132 "GLX_SLOW_CONFIG", # 0x8001
133 "GLX_TRUE_COLOR", # 0x8002
134 "GLX_DIRECT_COLOR", # 0x8003
135 "GLX_PSEUDO_COLOR", # 0x8004
136 "GLX_STATIC_COLOR", # 0x8005
137 "GLX_GRAY_SCALE", # 0x8006
138 "GLX_STATIC_GRAY", # 0x8007
139 "GLX_TRANSPARENT_RGB", # 0x8008
140 "GLX_TRANSPARENT_INDEX", # 0x8009
141 "GLX_VISUAL_ID", # 0x800B
142 "GLX_SCREEN", # 0x800C
143 "GLX_NON_CONFORMANT_CONFIG", # 0x800D
144 "GLX_DRAWABLE_TYPE", # 0x8010
145 "GLX_RENDER_TYPE", # 0x8011
146 "GLX_X_RENDERABLE", # 0x8012
147 "GLX_FBCONFIG_ID", # 0x8013
148 "GLX_RGBA_TYPE", # 0x8014
149 "GLX_COLOR_INDEX_TYPE", # 0x8015
150 "GLX_MAX_PBUFFER_WIDTH", # 0x8016
151 "GLX_MAX_PBUFFER_HEIGHT", # 0x8017
152 "GLX_MAX_PBUFFER_PIXELS", # 0x8018
153 "GLX_PRESERVED_CONTENTS", # 0x801B
154 "GLX_LARGEST_PBUFFER", # 0x801C
155 "GLX_WIDTH", # 0x801D
156 "GLX_HEIGHT", # 0x801E
157 "GLX_EVENT_MASK", # 0x801F
158 "GLX_DAMAGED", # 0x8020
159 "GLX_SAVED", # 0x8021
160 "GLX_WINDOW", # 0x8022
161 "GLX_PBUFFER", # 0x8023
162 "GLX_PBUFFER_HEIGHT", # 0x8040
163 "GLX_PBUFFER_WIDTH", # 0x8041
164
José Fonsecaecbfc9f2011-10-09 14:50:24 +0100165 "GLX_CONTEXT_PROFILE_MASK_ARB", # 0x9126
166
José Fonsecaafffa742011-05-09 23:43:39 +0100167 "GLX_SAMPLE_BUFFERS", # 100000
168 "GLX_SAMPLES", # 100001
169
170 "GLX_DONT_CARE", # 0xFFFFFFFF
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100171])
172
173GLXError = FakeEnum(Int, [
174 "GLX_BAD_SCREEN",
175 "GLX_BAD_ATTRIBUTE",
176 "GLX_NO_EXTENSION",
177 "GLX_BAD_VISUAL",
178 "GLX_BAD_CONTEXT",
179 "GLX_BAD_VALUE",
180 "GLX_BAD_ENUM",
181])
182
José Fonseca64674062011-05-10 20:33:43 +0100183GLXname = FakeEnum(Int, [
184 "GLX_VENDOR",
185 "GLX_VERSION",
186 "GLX_EXTENSIONS",
187])
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100188
189GLXbuffer = Flags(Int, [
190 "GLX_WINDOW_BIT",
191 "GLX_PIXMAP_BIT",
192 "GLX_PBUFFER_BIT",
193 "GLX_AUX_BUFFERS_BIT",
194 "GLX_FRONT_LEFT_BUFFER_BIT",
195 "GLX_FRONT_RIGHT_BUFFER_BIT",
196 "GLX_BACK_LEFT_BUFFER_BIT",
197 "GLX_BACK_RIGHT_BUFFER_BIT",
198 "GLX_DEPTH_BUFFER_BIT",
199 "GLX_STENCIL_BUFFER_BIT",
200 "GLX_ACCUM_BUFFER_BIT",
201])
202
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100203GLXbuffer = Flags(Int, [
204 "GLX_RGBA_BIT",
205 "GLX_COLOR_INDEX_BIT",
206 "GLX_PBUFFER_CLOBBER_MASK",
207])
José Fonseca99771fc2010-11-25 20:32:59 +0000208
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200209UnusedAttribs = AttribArray(GLXEnum, [])
210
Andreas Hartmetz0fd709f2013-07-09 22:54:49 +0200211GLXCommonSizeAttribs = [
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200212 ('GLX_RED_SIZE', UInt),
213 ('GLX_GREEN_SIZE', UInt),
214 ('GLX_BLUE_SIZE', UInt),
215 ('GLX_ALPHA_SIZE', UInt),
216 ('GLX_DEPTH_SIZE', UInt),
217 ('GLX_STENCIL_SIZE', UInt),
218 ('GLX_ACCUM_RED_SIZE', UInt),
219 ('GLX_ACCUM_GREEN_SIZE', UInt),
220 ('GLX_ACCUM_BLUE_SIZE', UInt),
Andreas Hartmetz0fd709f2013-07-09 22:54:49 +0200221 ('GLX_ACCUM_ALPHA_SIZE', UInt)
222]
223
224GLXVisualAttribs = AttribArray(GLXEnum, GLXCommonSizeAttribs + [
225 ('GLX_USE_GL', None),
226 ('GLX_BUFFER_SIZE', UInt),
227 ('GLX_LEVEL', Int),
228 ('GLX_RGBA', None),
229 ('GLX_DOUBLEBUFFER', None),
230 ('GLX_STEREO', None),
231 ('GLX_AUX_BUFFERS', UInt)],
232 isConst = False
233)
234
235GLXFBConfigCommonAttribs = GLXCommonSizeAttribs + [
236 ('GLX_BUFFER_SIZE', UInt),
237 ('GLX_LEVEL', Int),
238 ('GLX_DOUBLEBUFFER', Bool),
239 ('GLX_STEREO', Bool),
240 ('GLX_AUX_BUFFERS', UInt),
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200241 ('GLX_RENDER_TYPE', Flags(Int, ["GLX_RGBA_BIT", "GLX_COLOR_INDEX_BIT"])),
242 ('GLX_DRAWABLE_TYPE', Flags(Int, ["GLX_WINDOW_BIT", "GLX_PIXMAP_BIT", "GLX_PBUFFER_BIT"])),
243 ('GLX_X_RENDERABLE', Bool),
244 ('GLX_X_VISUAL_TYPE', FakeEnum(Int, ["GLX_TRUE_COLOR", "GLX_DIRECT_COLOR", "GLX_PSEUDO_COLOR", "GLX_STATIC_COLOR"])),
245 ('GLX_CONFIG_CAVEAT', FakeEnum(Int, ["GLX_NONE", "GLX_SLOW_CONFIG", "GLX_NON_CONFORMANT_CONFIG"])),
246 ('GLX_TRANSPARENT_TYPE', FakeEnum(Int, ["GLX_NONE", "GLX_TRANSPARENT_RGB", "GLX_TRANSPARENT_INDEX"])),
247 ('GLX_TRANSPARENT_INDEX_VALUE', Int),
248 ('GLX_TRANSPARENT_RED_VALUE', Int),
249 ('GLX_TRANSPARENT_GREEN_VALUE', Int),
250 ('GLX_TRANSPARENT_BLUE_VALUE', Int),
251 ('GLX_TRANSPARENT_ALPHA_VALUE', Int)
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200252]
253
254GLXFBConfigGLXAttribs = GLXFBConfigCommonAttribs + [
255 ('GLX_FBCONFIG_ID', Int), # an XID, can we do better than int?
256]
257
258GLXFBConfigSGIXAttribs = GLXFBConfigCommonAttribs + [
259 ('GLX_SAMPLE_BUFFERS', UInt),
260 ('GLX_SAMPLES', UInt)
261]
262
263GLXFBConfigAttribs = AttribArray(GLXEnum, GLXFBConfigGLXAttribs)
264GLXFBConfigSGIXAttribs = AttribArray(GLXEnum, GLXFBConfigSGIXAttribs, isConst = False)
265
Andreas Hartmetzba7bb0d2013-07-07 22:51:12 +0200266GLXContextAttribs = AttribArray(GLXEnum, [
267 ('GLX_CONTEXT_MAJOR_VERSION_ARB', Int),
268 ('GLX_CONTEXT_MINOR_VERSION_ARB', Int),
269 ('GLX_CONTEXT_FLAGS_ARB', Flags(Int, ["GLX_CONTEXT_DEBUG_BIT_ARB", "GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB"])),
270 ('GLX_CONTEXT_PROFILE_MASK_ARB', Flags(Int, ["GLX_CONTEXT_CORE_PROFILE_BIT_ARB", "GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB"]))
271])
272
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200273GLXPbufferAttribs = AttribArray(GLXEnum, [
274 ('GLX_PBUFFER_WIDTH', Int),
275 ('GLX_PBUFFER_HEIGHT', Int),
276 ('GLX_LARGEST_PBUFFER', Bool),
277 ('GLX_PRESERVED_CONTENTS', Bool)
278])
279
280GLXPbufferSGIXAttribs = AttribArray(GLXEnum, [
281 ('GLX_PRESERVED_CONTENTS_SGIX', Bool),
282 ('GLX_LARGEST_PBUFFER', Bool),
283 ('GLX_DIGITAL_MEDIA_PBUFFER_SGIX', Bool)],
284 isConst = False
285)
286
José Fonseca81301932012-11-11 00:10:20 +0000287glxapi = Module("GLX")
José Fonseca99771fc2010-11-25 20:32:59 +0000288
289PROC = Opaque("__GLXextFuncPtr")
290
José Fonseca54f304a2012-01-14 19:33:08 +0000291glxapi.addFunctions([
Zack Rusinf3f2e462011-03-23 18:35:39 -0400292 # GLX
Andreas Hartmetz0fd709f2013-07-09 22:54:49 +0200293 Function(Pointer(XVisualInfo), "glXChooseVisual", [(Display, "dpy"), (Int, "screen"), (GLXVisualAttribs, "attribList")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100294 Function(GLXContext, "glXCreateContext", [(Display, "dpy"), (Pointer(XVisualInfo), "vis"), (GLXContext, "shareList"), (Bool, "direct")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400295 Function(Void, "glXDestroyContext", [(Display, "dpy"), (GLXContext, "ctx")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100296 Function(Bool, "glXMakeCurrent", [(Display, "dpy"), (GLXDrawable, "drawable"), (GLXContext, "ctx")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400297 Function(Void, "glXCopyContext", [(Display, "dpy"), (GLXContext, "src"), (GLXContext, "dst"),
298 (ULong, "mask")]),
299 Function(Void, "glXSwapBuffers", [(Display, "dpy"), (GLXDrawable, "drawable")]),
300 Function(GLXPixmap, "glXCreateGLXPixmap", [(Display, "dpy"), (Pointer(XVisualInfo), "visual"),
301 (Pixmap, "pixmap")]),
302 Function(Void, "glXDestroyGLXPixmap", [(Display, "dpy"), (GLXPixmap, "pixmap")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100303 Function(Bool, "glXQueryExtension", [(Display, "dpy"), Out(Pointer(Int), "errorb"), Out(Pointer(Int), "event")]),
304 Function(Bool, "glXQueryVersion", [(Display, "dpy"), Out(Pointer(Int), "maj"), Out(Pointer(Int), "min")]),
305 Function(Bool, "glXIsDirect", [(Display, "dpy"), (GLXContext, "ctx")]),
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100306 Function(GLXError, "glXGetConfig", [(Display, "dpy"), (Pointer(XVisualInfo), "visual"),
José Fonseca1fcc39c2013-05-10 08:26:51 +0100307 (GLXEnum, "attrib"), Out(Pointer(Int), "value")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400308 Function(GLXContext, "glXGetCurrentContext", [], sideeffects=False),
309 Function(GLXDrawable, "glXGetCurrentDrawable", [], sideeffects=False),
310 Function(Void, "glXWaitGL", []),
311 Function(Void, "glXWaitX", []),
312 Function(Void, "glXUseXFont", [(Font, "font"), (Int, "first"), (Int, "count"), (Int, "list")]),
313
314 # GLX 1.1 and later
José Fonseca0358fa22012-10-13 09:26:17 +0100315 Function((ConstCString), "glXQueryExtensionsString", [(Display, "dpy"), (Int, "screen")], sideeffects=False),
316 Function((ConstCString), "glXQueryServerString", [(Display, "dpy"), (Int, "screen"), (GLXname, "name")], sideeffects=False),
317 Function((ConstCString), "glXGetClientString", [(Display, "dpy"), (GLXname, "name")], sideeffects=False),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400318
319 # GLX 1.2 and later
320 Function(Display, "glXGetCurrentDisplay", [], sideeffects=False),
321
322 # GLX 1.3 and later
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200323 Function(Array(GLXFBConfig, "*nitems"), "glXChooseFBConfig", [(Display, "dpy"), (Int, "screen"), (GLXFBConfigAttribs, "attribList"), Out(Pointer(Int), "nitems")]),
José Fonseca1fcc39c2013-05-10 08:26:51 +0100324 Function(Int, "glXGetFBConfigAttrib", [(Display, "dpy"), (GLXFBConfig, "config"), (GLXEnum, "attribute"), Out(Pointer(Int), "value")]),
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100325 Function(Array(GLXFBConfig, "*nelements"), "glXGetFBConfigs", [(Display, "dpy"), (Int, "screen"),
326 Out(Pointer(Int), "nelements")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400327 Function(Pointer(XVisualInfo), "glXGetVisualFromFBConfig", [(Display, "dpy"),
328 (GLXFBConfig, "config")]),
329 Function(GLXWindow, "glXCreateWindow", [(Display, "dpy"), (GLXFBConfig, "config"),
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200330 (Window, "win"), (UnusedAttribs, "attribList")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400331 Function(Void, "glXDestroyWindow", [(Display, "dpy"), (GLXWindow, "window")]),
332 Function(GLXPixmap, "glXCreatePixmap", [(Display, "dpy"), (GLXFBConfig, "config"),
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200333 (Pixmap, "pixmap"), (UnusedAttribs, "attribList")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400334 Function(Void, "glXDestroyPixmap", [(Display, "dpy"), (GLXPixmap, "pixmap")]),
335 Function(GLXPbuffer, "glXCreatePbuffer", [(Display, "dpy"), (GLXFBConfig, "config"),
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200336 (GLXPbufferAttribs, "attribList")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400337 Function(Void, "glXDestroyPbuffer", [(Display, "dpy"), (GLXPbuffer, "pbuf")]),
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100338 Function(Void, "glXQueryDrawable", [(Display, "dpy"), (GLXDrawable, "draw"), (GLXEnum, "attribute"),
339 Out(Pointer(UInt), "value")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400340 Function(GLXContext, "glXCreateNewContext", [(Display, "dpy"), (GLXFBConfig, "config"),
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100341 (GLXEnum, "renderType"), (GLXContext, "shareList"),
José Fonseca8d1f7272011-06-09 00:27:27 +0100342 (Bool, "direct")]),
343 Function(Bool, "glXMakeContextCurrent", [(Display, "dpy"), (GLXDrawable, "draw"),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400344 (GLXDrawable, "read"), (GLXContext, "ctx")]),
345 Function(GLXDrawable, "glXGetCurrentReadDrawable", []),
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100346 Function(Int, "glXQueryContext", [(Display, "dpy"), (GLXContext, "ctx"), (GLXEnum, "attribute"),
347 Out(Pointer(Int), "value")]),
Zack Rusinf3f2e462011-03-23 18:35:39 -0400348 Function(Void, "glXSelectEvent", [(Display, "dpy"), (GLXDrawable, "drawable"),
349 (ULong, "mask")]),
350 Function(Void, "glXGetSelectedEvent", [(Display, "dpy"), (GLXDrawable, "drawable"),
José Fonseca0d4ef5b2011-03-27 12:45:40 +0100351 Out(Pointer(ULong), "mask")]),
José Fonseca5a76ccf2011-06-03 19:34:55 +0100352
José Fonseca8d1f7272011-06-09 00:27:27 +0100353 # GLX_ARB_create_context
Andreas Hartmetzba7bb0d2013-07-07 22:51:12 +0200354 Function(GLXContext, "glXCreateContextAttribsARB", [(Display, "dpy"), (GLXFBConfig, "config"),
355 (GLXContext, "share_context"), (Bool, "direct"),
356 (GLXContextAttribs, "attrib_list")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100357
358 # GLX_SGI_swap_control
359 Function(Int, "glXSwapIntervalSGI", [(Int, "interval")]),
360
361 # GLX_SGI_video_sync
362 Function(Int, "glXGetVideoSyncSGI", [(OpaquePointer(UInt), "count")]),
363 Function(Int, "glXWaitVideoSyncSGI", [(Int, "divisor"), (Int, "remainder"), (OpaquePointer(UInt), "count")]),
364
365 # GLX_SGI_make_current_read
366 Function(Bool, "glXMakeCurrentReadSGI", [(Display, "dpy"), (GLXDrawable, "draw"), (GLXDrawable, "read"), (GLXContext, "ctx")]),
367 Function(GLXDrawable, "glXGetCurrentReadDrawableSGI", []),
368
369 # GLX_SGIX_video_source
370 #Function(GLXVideoSourceSGIX, "glXCreateGLXVideoSourceSGIX", [(Display, "display"), (Int, "screen"), (VLServer, "server"), (VLPath, "path"), (Int, "nodeClass"), (VLNode, "drainNode")]),
371 #Function(Void, "glXDestroyGLXVideoSourceSGIX", [(Display, "dpy"), (GLXVideoSourceSGIX, "glxvideosource")]),
372
373 # GLX_EXT_import_context
374 Function(Display, "glXGetCurrentDisplayEXT", []),
375 Function(Int, "glXQueryContextInfoEXT", [(Display, "dpy"), (GLXContext, "context"), (Int, "attribute"), (OpaquePointer(Int), "value")]),
376 Function(GLXContextID, "glXGetContextIDEXT", [(Const(GLXContext), "context")]),
377 Function(GLXContext, "glXImportContextEXT", [(Display, "dpy"), (GLXContextID, "contextID")]),
378 Function(Void, "glXFreeContextEXT", [(Display, "dpy"), (GLXContext, "context")]),
379
380 # GLX_SGIX_fbconfig
José Fonsecaecbfc9f2011-10-09 14:50:24 +0100381 Function(Int, "glXGetFBConfigAttribSGIX", [(Display, "dpy"), (GLXFBConfigSGIX, "config"), (Int, "attribute"), Out(Pointer(Int), "value")]),
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200382 Function(OpaquePointer(GLXFBConfigSGIX), "glXChooseFBConfigSGIX", [(Display, "dpy"), (Int, "screen"), (GLXFBConfigSGIXAttribs, "attrib_list"), Out(Pointer(Int), "nelements")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100383 Function(GLXPixmap, "glXCreateGLXPixmapWithConfigSGIX", [(Display, "dpy"), (GLXFBConfigSGIX, "config"), (Pixmap, "pixmap")]),
384 Function(GLXContext, "glXCreateContextWithConfigSGIX", [(Display, "dpy"), (GLXFBConfigSGIX, "config"), (Int, "render_type"), (GLXContext, "share_list"), (Bool, "direct")]),
José Fonseca6c463812012-02-01 19:51:34 +0000385 Function(Pointer(XVisualInfo), "glXGetVisualFromFBConfigSGIX", [(Display, "dpy"), (GLXFBConfigSGIX, "config")]),
José Fonsecaecbfc9f2011-10-09 14:50:24 +0100386 Function(GLXFBConfigSGIX, "glXGetFBConfigFromVisualSGIX", [(Display, "dpy"), Out(Pointer(XVisualInfo), "vis")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100387
388 # GLX_SGIX_pbuffer
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200389 Function(GLXPbufferSGIX, "glXCreateGLXPbufferSGIX", [(Display, "dpy"), (GLXFBConfigSGIX, "config"), (UInt, "width"), (UInt, "height"), (GLXPbufferSGIXAttribs, "attrib_list")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100390 Function(Void, "glXDestroyGLXPbufferSGIX", [(Display, "dpy"), (GLXPbufferSGIX, "pbuf")]),
José Fonseca6c463812012-02-01 19:51:34 +0000391 Function(Int, "glXQueryGLXPbufferSGIX", [(Display, "dpy"), (GLXPbufferSGIX, "pbuf"), (Int, "attribute"), Out(Pointer(UInt), "value")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100392 Function(Void, "glXSelectEventSGIX", [(Display, "dpy"), (GLXDrawable, "drawable"), (ULong, "mask")]),
José Fonseca6c463812012-02-01 19:51:34 +0000393 Function(Void, "glXGetSelectedEventSGIX", [(Display, "dpy"), (GLXDrawable, "drawable"), Out(Pointer(ULong), "mask")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100394
395 # GLX_SGI_cushion
396 Function(Void, "glXCushionSGI", [(Display, "dpy"), (Window, "window"), (Float, "cushion")]),
397
398 # GLX_SGIX_video_resize
399 Function(Int, "glXBindChannelToWindowSGIX", [(Display, "display"), (Int, "screen"), (Int, "channel"), (Window, "window")]),
400 Function(Int, "glXChannelRectSGIX", [(Display, "display"), (Int, "screen"), (Int, "channel"), (Int, "x"), (Int, "y"), (Int, "w"), (Int, "h")]),
401 Function(Int, "glXQueryChannelRectSGIX", [(Display, "display"), (Int, "screen"), (Int, "channel"), (OpaquePointer(Int), "dx"), (OpaquePointer(Int), "dy"), (OpaquePointer(Int), "dw"), (OpaquePointer(Int), "dh")]),
402 Function(Int, "glXQueryChannelDeltasSGIX", [(Display, "display"), (Int, "screen"), (Int, "channel"), (OpaquePointer(Int), "x"), (OpaquePointer(Int), "y"), (OpaquePointer(Int), "w"), (OpaquePointer(Int), "h")]),
403 Function(Int, "glXChannelRectSyncSGIX", [(Display, "display"), (Int, "screen"), (Int, "channel"), (GLenum, "synctype")]),
404
405 # GLX_SGIX_dmbuffer
406 #Function(Bool, "glXAssociateDMPbufferSGIX", [(Display, "dpy"), (GLXPbufferSGIX, "pbuffer"), (OpaquePointer(DMparams), "params"), (DMbuffer, "dmbuffer")]),
407
408 # GLX_SGIX_swap_group
409 Function(Void, "glXJoinSwapGroupSGIX", [(Display, "dpy"), (GLXDrawable, "drawable"), (GLXDrawable, "member")]),
410
411 # GLX_SGIX_swap_barrier
412 Function(Void, "glXBindSwapBarrierSGIX", [(Display, "dpy"), (GLXDrawable, "drawable"), (Int, "barrier")]),
413 Function(Bool, "glXQueryMaxSwapBarriersSGIX", [(Display, "dpy"), (Int, "screen"), (OpaquePointer(Int), "max")]),
414
415 # GLX_SUN_get_transparent_index
416 #Function(Status, "glXGetTransparentIndexSUN", [(Display, "dpy"), (Window, "overlay"), (Window, "underlay"), (OpaquePointer(Long), "pTransparentIndex")]),
417
418 # GLX_MESA_copy_sub_buffer
419 Function(Void, "glXCopySubBufferMESA", [(Display, "dpy"), (GLXDrawable, "drawable"), (Int, "x"), (Int, "y"), (Int, "width"), (Int, "height")]),
420
421 # GLX_MESA_pixmap_colormap
José Fonseca917329e2011-10-19 17:28:49 +0200422 Function(GLXPixmap, "glXCreateGLXPixmapMESA", [(Display, "dpy"), (Pointer(XVisualInfo), "visual"), (Pixmap, "pixmap"), (Colormap, "cmap")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100423
424 # GLX_MESA_release_buffers
425 Function(Bool, "glXReleaseBuffersMESA", [(Display, "dpy"), (GLXDrawable, "drawable")]),
426
427 # GLX_MESA_set_3dfx_mode
428 Function(Bool, "glXSet3DfxModeMESA", [(Int, "mode")]),
429
José Fonseca8dfb0e52012-01-10 19:39:12 +0000430 # GLX_MESA_swap_control
431 Function(Int, "glXSwapIntervalMESA", [(UInt, "interval")]),
José Fonseca0358fa22012-10-13 09:26:17 +0100432 Function(Int, "glXGetSwapIntervalMESA", [], sideeffects=False),
José Fonseca8dfb0e52012-01-10 19:39:12 +0000433
José Fonseca8d1f7272011-06-09 00:27:27 +0100434 # GLX_OML_sync_control
435 Function(Bool, "glXGetSyncValuesOML", [(Display, "dpy"), (GLXDrawable, "drawable"), (OpaquePointer(Int64), "ust"), (OpaquePointer(Int64), "msc"), (OpaquePointer(Int64), "sbc")]),
436 Function(Bool, "glXGetMscRateOML", [(Display, "dpy"), (GLXDrawable, "drawable"), (OpaquePointer(Int32), "numerator"), (OpaquePointer(Int32), "denominator")]),
437 Function(Int64, "glXSwapBuffersMscOML", [(Display, "dpy"), (GLXDrawable, "drawable"), (Int64, "target_msc"), (Int64, "divisor"), (Int64, "remainder")]),
438 Function(Bool, "glXWaitForMscOML", [(Display, "dpy"), (GLXDrawable, "drawable"), (Int64, "target_msc"), (Int64, "divisor"), (Int64, "remainder"), (OpaquePointer(Int64), "ust"), (OpaquePointer(Int64), "msc"), (OpaquePointer(Int64), "sbc")]),
439 Function(Bool, "glXWaitForSbcOML", [(Display, "dpy"), (GLXDrawable, "drawable"), (Int64, "target_sbc"), (OpaquePointer(Int64), "ust"), (OpaquePointer(Int64), "msc"), (OpaquePointer(Int64), "sbc")]),
440
441 # GLX_SGIX_hyperpipe
442 #Function(OpaquePointer(GLXHyperpipeNetworkSGIX), "glXQueryHyperpipeNetworkSGIX", [(Display, "dpy"), (OpaquePointer(Int), "npipes")]),
443 #Function(Int, "glXHyperpipeConfigSGIX", [(Display, "dpy"), (Int, "networkId"), (Int, "npipes"), (OpaquePointer(GLXHyperpipeConfigSGIX), "cfg"), (OpaquePointer(Int), "hpId")]),
444 #Function(OpaquePointer(GLXHyperpipeConfigSGIX), "glXQueryHyperpipeConfigSGIX", [(Display, "dpy"), (Int, "hpId"), (OpaquePointer(Int), "npipes")]),
445 #Function(Int, "glXDestroyHyperpipeConfigSGIX", [(Display, "dpy"), (Int, "hpId")]),
446 #Function(Int, "glXBindHyperpipeSGIX", [(Display, "dpy"), (Int, "hpId")]),
447 #Function(Int, "glXQueryHyperpipeBestAttribSGIX", [(Display, "dpy"), (Int, "timeSlice"), (Int, "attrib"), (Int, "size"), (OpaquePointer(Void), "attribList"), (OpaquePointer(Void), "returnAttribList")]),
448 #Function(Int, "glXHyperpipeAttribSGIX", [(Display, "dpy"), (Int, "timeSlice"), (Int, "attrib"), (Int, "size"), (OpaquePointer(Void), "attribList")]),
449 #Function(Int, "glXQueryHyperpipeAttribSGIX", [(Display, "dpy"), (Int, "timeSlice"), (Int, "attrib"), (Int, "size"), (OpaquePointer(Void), "returnAttribList")]),
450
451 # GLX_MESA_agp_offset
José Fonseca903c2ca2011-09-23 09:43:05 +0100452 Function(UInt, "glXGetAGPOffsetMESA", [(OpaquePointer(Const(Void)), "pointer")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100453
José Fonseca5a76ccf2011-06-03 19:34:55 +0100454 # EXT_texture_from_pixmap
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200455 Function(Void, "glXBindTexImageEXT", [(Display, "display"), (GLXDrawable, "drawable"), (GLXEnum, "buffer"), (GLXFBConfigAttribs, "attrib_list")]),
José Fonseca1fcc39c2013-05-10 08:26:51 +0100456 Function(Void, "glXReleaseTexImageEXT", [(Display, "display"), (GLXDrawable, "drawable"), (GLXEnum, "buffer")]),
José Fonseca5a76ccf2011-06-03 19:34:55 +0100457
José Fonseca8d1f7272011-06-09 00:27:27 +0100458 # GLX_NV_present_video
459 #Function(OpaquePointer(UInt), "glXEnumerateVideoDevicesNV", [(Display, "dpy"), (Int, "screen"), (OpaquePointer(Int), "nelements")]),
Andreas Hartmetzb936e552013-07-08 12:36:11 +0200460 #Function(Int, "glXBindVideoDeviceNV", [(Display, "dpy"), (UInt, "video_slot"), (UInt, "video_device"), (UnusedAttribs, "attrib_list")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100461
462 # GLX_NV_video_output
463 #Function(Int, "glXGetVideoDeviceNV", [(Display, "dpy"), (Int, "screen"), (Int, "numVideoDevices"), (OpaquePointer(GLXVideoDeviceNV), "pVideoDevice")]),
464 #Function(Int, "glXReleaseVideoDeviceNV", [(Display, "dpy"), (Int, "screen"), (GLXVideoDeviceNV, "VideoDevice")]),
465 #Function(Int, "glXBindVideoImageNV", [(Display, "dpy"), (GLXVideoDeviceNV, "VideoDevice"), (GLXPbuffer, "pbuf"), (Int, "iVideoBuffer")]),
466 #Function(Int, "glXReleaseVideoImageNV", [(Display, "dpy"), (GLXPbuffer, "pbuf")]),
467 #Function(Int, "glXSendPbufferToVideoNV", [(Display, "dpy"), (GLXPbuffer, "pbuf"), (Int, "iBufferType"), (OpaquePointer(ULong), "pulCounterPbuffer"), (GLboolean, "bBlock")]),
468 #Function(Int, "glXGetVideoInfoNV", [(Display, "dpy"), (Int, "screen"), (GLXVideoDeviceNV, "VideoDevice"), (OpaquePointer(ULong), "pulCounterOutputPbuffer"), (OpaquePointer(ULong), "pulCounterOutputVideo")]),
469
470 # GLX_NV_swap_group
471 Function(Bool, "glXJoinSwapGroupNV", [(Display, "dpy"), (GLXDrawable, "drawable"), (GLuint, "group")]),
472 Function(Bool, "glXBindSwapBarrierNV", [(Display, "dpy"), (GLuint, "group"), (GLuint, "barrier")]),
473 Function(Bool, "glXQuerySwapGroupNV", [(Display, "dpy"), (GLXDrawable, "drawable"), (OpaquePointer(GLuint), "group"), (OpaquePointer(GLuint), "barrier")]),
474 Function(Bool, "glXQueryMaxSwapGroupsNV", [(Display, "dpy"), (Int, "screen"), (OpaquePointer(GLuint), "maxGroups"), (OpaquePointer(GLuint), "maxBarriers")]),
475 Function(Bool, "glXQueryFrameCountNV", [(Display, "dpy"), (Int, "screen"), (OpaquePointer(GLuint), "count")]),
476 Function(Bool, "glXResetFrameCountNV", [(Display, "dpy"), (Int, "screen")]),
477
478 # GLX_NV_video_capture
479 #Function(Int, "glXBindVideoCaptureDeviceNV", [(Display, "dpy"), (UInt, "video_capture_slot"), (GLXVideoCaptureDeviceNV, "device")]),
480 #Function(OpaquePointer(GLXVideoCaptureDeviceNV), "glXEnumerateVideoCaptureDevicesNV", [(Display, "dpy"), (Int, "screen"), (OpaquePointer(Int), "nelements")]),
481 #Function(Void, "glXLockVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device")]),
482 #Function(Int, "glXQueryVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device"), (Int, "attribute"), (OpaquePointer(Int), "value")]),
483 #Function(Void, "glXReleaseVideoCaptureDeviceNV", [(Display, "dpy"), (GLXVideoCaptureDeviceNV, "device")]),
484
485 # GLX_EXT_swap_control
José Fonsecae319ab42012-03-10 15:37:43 +0000486 Function(Void, "glXSwapIntervalEXT", [(Display, "dpy"), (GLXDrawable, "drawable"), (Int, "interval")]),
José Fonseca8d1f7272011-06-09 00:27:27 +0100487
488 # GLX_NV_copy_image
489 Function(Void, "glXCopyImageSubDataNV", [(Display, "dpy"), (GLXContext, "srcCtx"), (GLuint, "srcName"), (GLenum, "srcTarget"), (GLint, "srcLevel"), (GLint, "srcX"), (GLint, "srcY"), (GLint, "srcZ"), (GLXContext, "dstCtx"), (GLuint, "dstName"), (GLenum, "dstTarget"), (GLint, "dstLevel"), (GLint, "dstX"), (GLint, "dstY"), (GLint, "dstZ"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth")]),
José Fonsecae90885a2010-11-26 15:01:18 +0000490
José Fonseca5b92de62011-09-19 19:59:44 +0100491 # GLX_NV_vertex_array_range
492 Function(OpaquePointer(Void), "glXAllocateMemoryNV", [(GLsizei, "size"), (GLfloat, "readfreq"), (GLfloat, "writefreq"), (GLfloat, "priority")]),
493 Function(Void, "glXFreeMemoryNV", [(OpaquePointer(Void), "pointer")]),
494
José Fonseca4a826ed2010-11-30 16:58:22 +0000495 # Must be last
José Fonsecabcfc81b2012-08-07 21:07:22 +0100496 Function(PROC, "glXGetProcAddressARB", [(String(Const(GLubyte)), "procName")]),
497 Function(PROC, "glXGetProcAddress", [(String(Const(GLubyte)), "procName")]),
José Fonseca99771fc2010-11-25 20:32:59 +0000498])
499
500
José Fonseca7ec90502012-04-16 20:09:42 +0100501# To prevent collision with stdapi.Bool
502del Bool