Merge branch 'gles2-2'
[mesa.git] / src / glx / apple / gen_exports.tcl
1 if 0 {
2 Copyright (c) 2008, 2009 Apple Inc.
3
4 Permission is hereby granted, free of charge, to any person
5 obtaining a copy of this software and associated documentation files
6 (the "Software"), to deal in the Software without restriction,
7 including without limitation the rights to use, copy, modify, merge,
8 publish, distribute, sublicense, and/or sell copies of the Software,
9 and to permit persons to whom the Software is furnished to do so,
10 subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be
13 included in all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
19 HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 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
22 DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the name(s) of the above
25 copyright holders shall not be used in advertising or otherwise to
26 promote the sale, use or other dealings in this Software without
27 prior written authorization.
28 }
29
30 package require Tcl 8.5
31
32 proc main {argc argv} {
33 if {2 != $argc} {
34 puts stderr "syntax is: [info script] serialized-array-file export.list"
35 return 1
36 }
37
38 set fd [open [lindex $argv 0] r]
39 array set api [read $fd]
40 close $fd
41
42 #Start with 1.0
43 set glxlist [list \
44 glXChooseVisual glXCreateContext glXDestroyContext \
45 glXMakeCurrent glXCopyContext glXSwapBuffers \
46 glXCreateGLXPixmap glXDestroyGLXPixmap \
47 glXQueryExtension glXQueryVersion \
48 glXIsDirect glXGetConfig \
49 glXGetCurrentContext glXGetCurrentDrawable \
50 glXWaitGL glXWaitX glXUseXFont]
51
52 #GLX 1.1 and later
53 lappend glxlist glXQueryExtensionsString glXQueryServerString \
54 glXGetClientString
55
56 #GLX 1.2 and later
57 lappend glxlist glXGetCurrentDisplay
58
59 #GLX 1.3 and later
60 lappend glxlist glXChooseFBConfig glXGetFBConfigAttrib \
61 glXGetFBConfigs glXGetVisualFromFBConfig \
62 glXCreateWindow glXDestroyWindow \
63 glXCreatePixmap glXDestroyPixmap \
64 glXCreatePbuffer glXDestroyPbuffer \
65 glXQueryDrawable glXCreateNewContext \
66 glXMakeContextCurrent glXGetCurrentReadDrawable \
67 glXQueryContext glXSelectEvent glXGetSelectedEvent
68
69 #GLX 1.4 and later
70 lappend glxlist glXGetProcAddress
71
72 #Extensions
73 lappend glxlist glXGetProcAddressARB
74
75 #Old extensions we don't support and never really have, but need for
76 #symbol compatibility. See also: glx_empty.c
77 lappend glxlist glXSwapIntervalSGI glXSwapIntervalMESA \
78 glXGetSwapIntervalMESA glXBeginFrameTrackingMESA \
79 glXEndFrameTrackingMESA glXGetFrameUsageMESA \
80 glXQueryFrameTrackingMESA glXGetVideoSyncSGI \
81 glXWaitVideoSyncSGI glXJoinSwapGroupSGIX \
82 glXBindSwapBarrierSGIX glXQueryMaxSwapBarriersSGIX \
83 glXGetSyncValuesOML glXSwapBuffersMscOML \
84 glXWaitForMscOML glXWaitForSbcOML \
85 glXAllocateMemoryMESA glXFreeMemoryMESA \
86 glXGetMemoryOffsetMESA glXReleaseBuffersMESA \
87 glXCreateGLXPixmapMESA glXCopySubBufferMESA \
88 glXQueryGLXPbufferSGIX glXCreateGLXPbufferSGIX \
89 glXDestroyGLXPbufferSGIX glXSelectEventSGIX \
90 glXGetSelectedEventSGIX
91
92 #These are for GLX_SGIX_fbconfig, which isn't implemented, because
93 #we have the GLX 1.3 GLXFBConfig functions which are in the standard spec.
94 #It should be possible to support these to some extent.
95 #The old libGL somewhat supported the GLXFBConfigSGIX code, but lacked
96 #pbuffer, and pixmap support.
97 #We mainly just need these stubs for linking with apps, because for
98 #some reason the OpenGL site suggests using the latest glxext.h,
99 #and glxext.h defines all GLX extensions, which doesn't seem right for
100 #compile-time capability detection.
101 #See also: http://www.mesa3d.org/brianp/sig97/exten.htm#Compile
102 #which conflicts with: the ABI registry from what I saw on opengl.org.
103 #By disabling some of the #defines in glxext.h we break some software,
104 #and by enabling them without the symbols we break others (in Mesa).
105 #I think a lot of OpenGL-based programs have issues one way or another.
106 #It seems that even Mesa developers are confused on this issue, because
107 #Mesa-7.3/progs/xdemos/glxgears_fbconfig.c has comments about breakage
108 #in some comments.
109 lappend glxlist glXGetFBConfigAttribSGIX \
110 glXChooseFBConfigSGIX \
111 glXGetVisualFromFBConfigSGIX \
112 glXCreateGLXPixmapWithConfigSGIX \
113 glXCreateContextWithConfigSGIX \
114 glXGetFBConfigFromVisualSGIX
115
116
117 set fd [open [lindex $argv 1] w]
118
119 foreach f [lsort -dictionary [array names api]] {
120 puts $fd _gl$f
121 }
122
123 foreach f [lsort -dictionary $glxlist] {
124 puts $fd _$f
125 }
126
127 close $fd
128
129 return 0
130 }
131
132 exit [main $::argc $::argv]