1 /* $Id: realglx.c,v 1.6 2002/10/08 23:16:27 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 struct _glxapi_table
*
35 _real_GetGLXDispatchTable(void)
37 static struct _glxapi_table glx
;
39 /* be sure our dispatch table size <= libGL's table */
41 GLuint size
= sizeof(struct _glxapi_table
) / sizeof(void *);
43 assert(_glxapi_get_dispatch_table_size() >= size
);
46 /* initialize the whole table to no-ops */
47 _glxapi_set_no_op_table(&glx
);
49 /* now initialize the table with the functions I implement */
51 /*** GLX_VERSION_1_0 ***/
52 glx
.ChooseVisual
= _real_glXChooseVisual
;
53 glx
.CopyContext
= _real_glXCopyContext
;
54 glx
.CreateContext
= _real_glXCreateContext
;
55 glx
.CreateGLXPixmap
= _real_glXCreateGLXPixmap
;
56 glx
.DestroyContext
= _real_glXDestroyContext
;
57 glx
.DestroyGLXPixmap
= _real_glXDestroyGLXPixmap
;
58 glx
.GetConfig
= _real_glXGetConfig
;
59 /*glx.GetCurrentContext = _real_glXGetCurrentContext;*/
60 /*glx.GetCurrentDrawable = _real_glXGetCurrentDrawable;*/
61 glx
.IsDirect
= _real_glXIsDirect
;
62 glx
.MakeCurrent
= _real_glXMakeCurrent
;
63 glx
.QueryExtension
= _real_glXQueryExtension
;
64 glx
.QueryVersion
= _real_glXQueryVersion
;
65 glx
.SwapBuffers
= _real_glXSwapBuffers
;
66 glx
.UseXFont
= _real_glXUseXFont
;
67 glx
.WaitGL
= _real_glXWaitGL
;
68 glx
.WaitX
= _real_glXWaitX
;
70 /*** GLX_VERSION_1_1 ***/
71 glx
.GetClientString
= _real_glXGetClientString
;
72 glx
.QueryExtensionsString
= _real_glXQueryExtensionsString
;
73 glx
.QueryServerString
= _real_glXQueryServerString
;
75 /*** GLX_VERSION_1_2 ***/
76 /*glx.GetCurrentDisplay = _real_glXGetCurrentDisplay;*/
78 /*** GLX_VERSION_1_3 ***/
79 glx
.ChooseFBConfig
= _real_glXChooseFBConfig
;
80 glx
.CreateNewContext
= _real_glXCreateNewContext
;
81 glx
.CreatePbuffer
= _real_glXCreatePbuffer
;
82 glx
.CreatePixmap
= _real_glXCreatePixmap
;
83 glx
.CreateWindow
= _real_glXCreateWindow
;
84 glx
.DestroyPbuffer
= _real_glXDestroyPbuffer
;
85 glx
.DestroyPixmap
= _real_glXDestroyPixmap
;
86 glx
.DestroyWindow
= _real_glXDestroyWindow
;
87 /*glx.GetCurrentReadDrawable = _real_glXGetCurrentReadDrawable;*/
88 glx
.GetFBConfigAttrib
= _real_glXGetFBConfigAttrib
;
89 glx
.GetFBConfigs
= _real_glXGetFBConfigs
;
90 glx
.GetSelectedEvent
= _real_glXGetSelectedEvent
;
91 glx
.GetVisualFromFBConfig
= _real_glXGetVisualFromFBConfig
;
92 glx
.MakeContextCurrent
= _real_glXMakeContextCurrent
;
93 glx
.QueryContext
= _real_glXQueryContext
;
94 glx
.QueryDrawable
= _real_glXQueryDrawable
;
95 glx
.SelectEvent
= _real_glXSelectEvent
;
97 /*** GLX_SGI_swap_control ***/
98 glx
.SwapIntervalSGI
= _real_glXSwapIntervalSGI
;
100 /*** GLX_SGI_video_sync ***/
101 glx
.GetVideoSyncSGI
= _real_glXGetVideoSyncSGI
;
102 glx
.WaitVideoSyncSGI
= _real_glXWaitVideoSyncSGI
;
104 /*** GLX_SGI_make_current_read ***/
105 glx
.MakeCurrentReadSGI
= _real_glXMakeCurrentReadSGI
;
106 /*glx.GetCurrentReadDrawableSGI = _real_glXGetCurrentReadDrawableSGI;*/
109 /*** GLX_SGIX_video_source ***/
110 glx
.CreateGLXVideoSourceSGIX
= _real_glXCreateGLXVideoSourceSGIX
;
111 glx
.DestroyGLXVideoSourceSGIX
= _real_glXDestroyGLXVideoSourceSGIX
;
114 /*** GLX_EXT_import_context ***/
115 glx
.FreeContextEXT
= _real_glXFreeContextEXT
;
116 /*glx.GetContextIDEXT = _real_glXGetContextIDEXT;*/
117 /*glx.GetCurrentDisplayEXT = _real_glXGetCurrentDisplayEXT;*/
118 glx
.ImportContextEXT
= _real_glXImportContextEXT
;
119 glx
.QueryContextInfoEXT
= _real_glXQueryContextInfoEXT
;
121 /*** GLX_SGIX_fbconfig ***/
122 glx
.GetFBConfigAttribSGIX
= _real_glXGetFBConfigAttribSGIX
;
123 glx
.ChooseFBConfigSGIX
= _real_glXChooseFBConfigSGIX
;
124 glx
.CreateGLXPixmapWithConfigSGIX
= _real_glXCreateGLXPixmapWithConfigSGIX
;
125 glx
.CreateContextWithConfigSGIX
= _real_glXCreateContextWithConfigSGIX
;
126 glx
.GetVisualFromFBConfigSGIX
= _real_glXGetVisualFromFBConfigSGIX
;
127 glx
.GetFBConfigFromVisualSGIX
= _real_glXGetFBConfigFromVisualSGIX
;
129 /*** GLX_SGIX_pbuffer ***/
130 glx
.CreateGLXPbufferSGIX
= _real_glXCreateGLXPbufferSGIX
;
131 glx
.DestroyGLXPbufferSGIX
= _real_glXDestroyGLXPbufferSGIX
;
132 glx
.QueryGLXPbufferSGIX
= _real_glXQueryGLXPbufferSGIX
;
133 glx
.SelectEventSGIX
= _real_glXSelectEventSGIX
;
134 glx
.GetSelectedEventSGIX
= _real_glXGetSelectedEventSGIX
;
136 /*** GLX_SGI_cushion ***/
137 glx
.CushionSGI
= _real_glXCushionSGI
;
139 /*** GLX_SGIX_video_resize ***/
140 glx
.BindChannelToWindowSGIX
= _real_glXBindChannelToWindowSGIX
;
141 glx
.ChannelRectSGIX
= _real_glXChannelRectSGIX
;
142 glx
.QueryChannelRectSGIX
= _real_glXQueryChannelRectSGIX
;
143 glx
.QueryChannelDeltasSGIX
= _real_glXQueryChannelDeltasSGIX
;
144 glx
.ChannelRectSyncSGIX
= _real_glXChannelRectSyncSGIX
;
146 #if defined(_DM_BUFFER_H_)
147 /*** (GLX_SGIX_dmbuffer ***/
148 glx
.AssociateDMPbufferSGIX
= NULL
;
151 /*** GLX_SGIX_swap_group ***/
152 glx
.JoinSwapGroupSGIX
= _real_glXJoinSwapGroupSGIX
;
154 /*** GLX_SGIX_swap_barrier ***/
155 glx
.BindSwapBarrierSGIX
= _real_glXBindSwapBarrierSGIX
;
156 glx
.QueryMaxSwapBarriersSGIX
= _real_glXQueryMaxSwapBarriersSGIX
;
158 /*** GLX_SUN_get_transparent_index ***/
159 glx
.GetTransparentIndexSUN
= _real_glXGetTransparentIndexSUN
;
161 /*** GLX_MESA_copy_sub_buffer ***/
162 glx
.CopySubBufferMESA
= _real_glXCopySubBufferMESA
;
164 /*** GLX_MESA_release_buffers ***/
165 glx
.ReleaseBuffersMESA
= _real_glXReleaseBuffersMESA
;
167 /*** GLX_MESA_pixmap_colormap ***/
168 glx
.CreateGLXPixmapMESA
= _real_glXCreateGLXPixmapMESA
;
170 /*** GLX_MESA_set_3dfx_mode ***/
171 glx
.Set3DfxModeMESA
= _real_glXSet3DfxModeMESA
;
173 /*** GLX_NV_vertex_array_range ***/
174 glx
.AllocateMemoryNV
= _real_glXAllocateMemoryNV
;
175 glx
.FreeMemoryNV
= _real_glXFreeMemoryNV
;
177 /*** GLX_MESA_agp_offset ***/
178 glx
.GetAGPOffsetMESA
= _real_glXGetAGPOffsetMESA
;