1ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul/*
2ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * Mesa 3-D graphics library
3ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul *
44a4039e1996a65ebced473fa03a3a970825746ffBrian Paul * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
54a4039e1996a65ebced473fa03a3a970825746ffBrian Paul * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
6ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul *
7ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * Permission is hereby granted, free of charge, to any person obtaining a
8ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * copy of this software and associated documentation files (the "Software"),
9ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * to deal in the Software without restriction, including without limitation
10ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * and/or sell copies of the Software, and to permit persons to whom the
12ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * Software is furnished to do so, subject to the following conditions:
13ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul *
14ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * The above copyright notice and this permission notice shall be included
15ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * in all copies or substantial portions of the Software.
16ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul *
17ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
203d8d5b298a268b119d840bc9bae0ee9e0c9244a9Kenneth Graunke * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
213d8d5b298a268b119d840bc9bae0ee9e0c9244a9Kenneth Graunke * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
223d8d5b298a268b119d840bc9bae0ee9e0c9244a9Kenneth Graunke * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
233d8d5b298a268b119d840bc9bae0ee9e0c9244a9Kenneth Graunke * OTHER DEALINGS IN THE SOFTWARE.
24ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul */
25ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
26ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
2710eb2ca9540dc4d96933fa1d7c1a92d3e040a5bdBrian Paul/**
2810eb2ca9540dc4d96933fa1d7c1a92d3e040a5bdBrian Paul * glXGetProcAddress()
29ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul */
30ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
31ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
324a4039e1996a65ebced473fa03a3a970825746ffBrian Paul#define GLX_GLXEXT_PROTOTYPES
334a4039e1996a65ebced473fa03a3a970825746ffBrian Paul
34ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul#include <string.h>
3525656753d765680ea4a592ff812deac132e2262dBrian Paul#include "pipe/p_compiler.h"
364a4039e1996a65ebced473fa03a3a970825746ffBrian Paul#include "GL/glx.h"
376f467e57376e94a6da0e3d363ecaecc52ca8a3c8Brian Paul#include "glapi/glapi.h"
38ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
39ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
40ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paulstruct name_address_pair {
41ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   const char *Name;
42ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   __GLXextFuncPtr Address;
43ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul};
44ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
454a4039e1996a65ebced473fa03a3a970825746ffBrian Paul
46ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paulstatic struct name_address_pair GLX_functions[] = {
47ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_VERSION_1_0 ***/
48ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXChooseVisual", (__GLXextFuncPtr) glXChooseVisual },
49ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCopyContext", (__GLXextFuncPtr) glXCopyContext },
50ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateContext", (__GLXextFuncPtr) glXCreateContext },
51ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateGLXPixmap", (__GLXextFuncPtr) glXCreateGLXPixmap },
52ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXDestroyContext", (__GLXextFuncPtr) glXDestroyContext },
53ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXDestroyGLXPixmap", (__GLXextFuncPtr) glXDestroyGLXPixmap },
54ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetConfig", (__GLXextFuncPtr) glXGetConfig },
55ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetCurrentContext", (__GLXextFuncPtr) glXGetCurrentContext },
56ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetCurrentDrawable", (__GLXextFuncPtr) glXGetCurrentDrawable },
57ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXIsDirect", (__GLXextFuncPtr) glXIsDirect },
58ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXMakeCurrent", (__GLXextFuncPtr) glXMakeCurrent },
59ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryExtension", (__GLXextFuncPtr) glXQueryExtension },
60ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryVersion", (__GLXextFuncPtr) glXQueryVersion },
61ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXSwapBuffers", (__GLXextFuncPtr) glXSwapBuffers },
62ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXUseXFont", (__GLXextFuncPtr) glXUseXFont },
63ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXWaitGL", (__GLXextFuncPtr) glXWaitGL },
64ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXWaitX", (__GLXextFuncPtr) glXWaitX },
65ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
66ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_VERSION_1_1 ***/
67ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetClientString", (__GLXextFuncPtr) glXGetClientString },
68ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryExtensionsString", (__GLXextFuncPtr) glXQueryExtensionsString },
69ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryServerString", (__GLXextFuncPtr) glXQueryServerString },
70ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
71ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_VERSION_1_2 ***/
72ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetCurrentDisplay", (__GLXextFuncPtr) glXGetCurrentDisplay },
73ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
74ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_VERSION_1_3 ***/
75ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXChooseFBConfig", (__GLXextFuncPtr) glXChooseFBConfig },
76ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateNewContext", (__GLXextFuncPtr) glXCreateNewContext },
77ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreatePbuffer", (__GLXextFuncPtr) glXCreatePbuffer },
78ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreatePixmap", (__GLXextFuncPtr) glXCreatePixmap },
79ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateWindow", (__GLXextFuncPtr) glXCreateWindow },
80ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXDestroyPbuffer", (__GLXextFuncPtr) glXDestroyPbuffer },
81ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXDestroyPixmap", (__GLXextFuncPtr) glXDestroyPixmap },
82ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXDestroyWindow", (__GLXextFuncPtr) glXDestroyWindow },
83ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetCurrentReadDrawable", (__GLXextFuncPtr) glXGetCurrentReadDrawable },
84ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetFBConfigAttrib", (__GLXextFuncPtr) glXGetFBConfigAttrib },
85ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetFBConfigs", (__GLXextFuncPtr) glXGetFBConfigs },
86ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetSelectedEvent", (__GLXextFuncPtr) glXGetSelectedEvent },
87ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetVisualFromFBConfig", (__GLXextFuncPtr) glXGetVisualFromFBConfig },
88ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXMakeContextCurrent", (__GLXextFuncPtr) glXMakeContextCurrent },
89ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryContext", (__GLXextFuncPtr) glXQueryContext },
90ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryDrawable", (__GLXextFuncPtr) glXQueryDrawable },
91ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXSelectEvent", (__GLXextFuncPtr) glXSelectEvent },
92ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
93ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_VERSION_1_4 ***/
94ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetProcAddress", (__GLXextFuncPtr) glXGetProcAddress },
95ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
96ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGI_swap_control ***/
97ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXSwapIntervalSGI", (__GLXextFuncPtr) glXSwapIntervalSGI },
98ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
99ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGI_video_sync ***/
100ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetVideoSyncSGI", (__GLXextFuncPtr) glXGetVideoSyncSGI },
101ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXWaitVideoSyncSGI", (__GLXextFuncPtr) glXWaitVideoSyncSGI },
102ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
103ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGI_make_current_read ***/
104ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXMakeCurrentReadSGI", (__GLXextFuncPtr) glXMakeCurrentReadSGI },
105ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetCurrentReadDrawableSGI", (__GLXextFuncPtr) glXGetCurrentReadDrawableSGI },
106ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
107ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGIX_video_source ***/
108ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul#if defined(_VL_H)
109ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateGLXVideoSourceSGIX", (__GLXextFuncPtr) glXCreateGLXVideoSourceSGIX },
110ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXDestroyGLXVideoSourceSGIX", (__GLXextFuncPtr) glXDestroyGLXVideoSourceSGIX },
111ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul#endif
112ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
113ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_EXT_import_context ***/
114ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXFreeContextEXT", (__GLXextFuncPtr) glXFreeContextEXT },
115ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetContextIDEXT", (__GLXextFuncPtr) glXGetContextIDEXT },
116ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetCurrentDisplayEXT", (__GLXextFuncPtr) glXGetCurrentDisplayEXT },
117ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXImportContextEXT", (__GLXextFuncPtr) glXImportContextEXT },
118ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryContextInfoEXT", (__GLXextFuncPtr) glXQueryContextInfoEXT },
119ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
120ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGIX_fbconfig ***/
121ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetFBConfigAttribSGIX", (__GLXextFuncPtr) glXGetFBConfigAttribSGIX },
122ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXChooseFBConfigSGIX", (__GLXextFuncPtr) glXChooseFBConfigSGIX },
123ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateGLXPixmapWithConfigSGIX", (__GLXextFuncPtr) glXCreateGLXPixmapWithConfigSGIX },
124ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateContextWithConfigSGIX", (__GLXextFuncPtr) glXCreateContextWithConfigSGIX },
125ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetVisualFromFBConfigSGIX", (__GLXextFuncPtr) glXGetVisualFromFBConfigSGIX },
126ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetFBConfigFromVisualSGIX", (__GLXextFuncPtr) glXGetFBConfigFromVisualSGIX },
127ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
128ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGIX_pbuffer ***/
129ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateGLXPbufferSGIX", (__GLXextFuncPtr) glXCreateGLXPbufferSGIX },
130ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXDestroyGLXPbufferSGIX", (__GLXextFuncPtr) glXDestroyGLXPbufferSGIX },
131ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryGLXPbufferSGIX", (__GLXextFuncPtr) glXQueryGLXPbufferSGIX },
132ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXSelectEventSGIX", (__GLXextFuncPtr) glXSelectEventSGIX },
133ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetSelectedEventSGIX", (__GLXextFuncPtr) glXGetSelectedEventSGIX },
134ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
135ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGI_cushion ***/
136ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCushionSGI", (__GLXextFuncPtr) glXCushionSGI },
137ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
138ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGIX_video_resize ***/
139ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXBindChannelToWindowSGIX", (__GLXextFuncPtr) glXBindChannelToWindowSGIX },
140ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXChannelRectSGIX", (__GLXextFuncPtr) glXChannelRectSGIX },
141ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryChannelRectSGIX", (__GLXextFuncPtr) glXQueryChannelRectSGIX },
142ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryChannelDeltasSGIX", (__GLXextFuncPtr) glXQueryChannelDeltasSGIX },
143ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXChannelRectSyncSGIX", (__GLXextFuncPtr) glXChannelRectSyncSGIX },
144ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
145ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGIX_dmbuffer **/
146ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul#if defined(_DM_BUFFER_H_)
147ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXAssociateDMPbufferSGIX", (__GLXextFuncPtr) glXAssociateDMPbufferSGIX },
148ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul#endif
149ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
150ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGIX_swap_group ***/
151ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXJoinSwapGroupSGIX", (__GLXextFuncPtr) glXJoinSwapGroupSGIX },
152ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
153ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SGIX_swap_barrier ***/
154ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXBindSwapBarrierSGIX", (__GLXextFuncPtr) glXBindSwapBarrierSGIX },
155ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXQueryMaxSwapBarriersSGIX", (__GLXextFuncPtr) glXQueryMaxSwapBarriersSGIX },
156ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
157ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_SUN_get_transparent_index ***/
158ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetTransparentIndexSUN", (__GLXextFuncPtr) glXGetTransparentIndexSUN },
159ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
160ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_MESA_copy_sub_buffer ***/
161ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCopySubBufferMESA", (__GLXextFuncPtr) glXCopySubBufferMESA },
162ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
163ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_MESA_pixmap_colormap ***/
164ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXCreateGLXPixmapMESA", (__GLXextFuncPtr) glXCreateGLXPixmapMESA },
165ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
166ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_MESA_release_buffers ***/
167ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXReleaseBuffersMESA", (__GLXextFuncPtr) glXReleaseBuffersMESA },
168ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
169ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_ARB_get_proc_address ***/
170ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXGetProcAddressARB", (__GLXextFuncPtr) glXGetProcAddressARB },
171ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
1729f865646f1fb05cec72dcb1d7411670d38b0a9b4José Fonseca   /*** GLX_ARB_create_context ***/
1739f865646f1fb05cec72dcb1d7411670d38b0a9b4José Fonseca   { "glXCreateContextAttribsARB", (__GLXextFuncPtr) glXCreateContextAttribsARB },
1749f865646f1fb05cec72dcb1d7411670d38b0a9b4José Fonseca
175ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   /*** GLX_EXT_texture_from_pixmap ***/
176ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXBindTexImageEXT", (__GLXextFuncPtr) glXBindTexImageEXT },
177ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { "glXReleaseTexImageEXT", (__GLXextFuncPtr) glXReleaseTexImageEXT },
178ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
179ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   { NULL, NULL }   /* end of list */
180ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul};
181ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
182ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
183ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
1844a4039e1996a65ebced473fa03a3a970825746ffBrian Paul/**
185ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul * Return address of named glX function, or NULL if not found.
186ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul */
1874a4039e1996a65ebced473fa03a3a970825746ffBrian Paulstatic __GLXextFuncPtr
188ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul_glxapi_get_proc_address(const char *funcName)
189ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul{
190ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   GLuint i;
191ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   for (i = 0; GLX_functions[i].Name; i++) {
192ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul      if (strcmp(GLX_functions[i].Name, funcName) == 0)
193ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul         return GLX_functions[i].Address;
194ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   }
195ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   return NULL;
196ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul}
197ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
198ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
1990e4e2c57d1b5659ba4fce2f9077fb6d4c7fd18d5Jakob BornecrantzPUBLIC __GLXextFuncPtr
200ef25c496d52f4f6c45816b64b4c0999321476cd7Brian PaulglXGetProcAddressARB(const GLubyte *procName)
201ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul{
202ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   __GLXextFuncPtr f;
203ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
204ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   f = _glxapi_get_proc_address((const char *) procName);
205ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   if (f) {
206ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul      return f;
207ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   }
208ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
209ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   f = (__GLXextFuncPtr) _glapi_get_proc_address((const char *) procName);
210ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   return f;
211ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul}
212ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
213ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul
214ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul/* GLX 1.4 */
215cca66dbb59673168d57b4e3499ccc31f4ddc86adChia-I WuPUBLIC
216ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paulvoid (*glXGetProcAddress(const GLubyte *procName))()
217ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul{
218ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul   return glXGetProcAddressARB(procName);
219ef25c496d52f4f6c45816b64b4c0999321476cd7Brian Paul}
220