2ca689e6e0a0a97a871fd1d9fe1566607f1b1446
[mesa.git] / src / mesa / glapi / glapi.c
1 /* $Id: glapi.c,v 1.10 1999/11/27 21:30:40 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 *
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
8 *
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:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
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.
25 */
26
27
28 /*
29 * This file manages the OpenGL API dispatch layer.
30 * The dispatch table (struct _glapi_table) is basically just a list
31 * of function pointers.
32 * There are functions to set/get the current dispatch table for the
33 * current thread and to manage registration/dispatch of dynamically
34 * added extension functions.
35 */
36
37
38
39 #include <assert.h>
40 #include <stdlib.h> /* to get NULL */
41 #include <string.h>
42 #include "glapi.h"
43 #include "glapinoop.h"
44
45
46
47 /*
48 * Define the DISPATCH_SETUP and DISPATCH macros here dependant on
49 * whether or not threading is enabled.
50 */
51 #if defined(THREADS)
52
53 /*** Thread-safe API dispatch ***/
54 #include "mthreads.h"
55 static MesaTSD mesa_dispatch_tsd;
56 static void mesa_dispatch_thread_init() {
57 MesaInitTSD(&mesa_dispatch_tsd);
58 }
59 #define DISPATCH_SETUP struct _glapi_table *dispatch = (struct _glapi_table *) MesaGetTSD(&mesa_dispatch_tsd)
60 #define DISPATCH(FUNC, ARGS) (dispatch->FUNC) ARGS
61
62
63 #else
64
65 /*** Non-threaded API dispatch ***/
66 static struct _glapi_table *Dispatch = &__glapi_noop_table;
67 #define DISPATCH_SETUP
68 #define DISPATCH(FUNC, ARGS) (Dispatch->FUNC) ARGS
69
70 #endif
71
72
73
74 /*
75 * Set the global or per-thread dispatch table pointer.
76 */
77 void
78 _glapi_set_dispatch(struct _glapi_table *dispatch)
79 {
80 if (!dispatch) {
81 /* use the no-op functions */
82 dispatch = &__glapi_noop_table;
83 }
84 #ifdef DEBUG
85 else {
86 _glapi_check_table(dispatch);
87 }
88 #endif
89
90 #if defined(THREADS)
91 MesaSetTSD(&mesa_dispatch_tsd, (void*) dispatch, mesa_dispatch_thread_init);
92 #else
93 Dispatch = dispatch;
94 #endif
95 }
96
97
98 /*
99 * Get the global or per-thread dispatch table pointer.
100 */
101 struct _glapi_table *
102 _glapi_get_dispatch(void)
103 {
104 #if defined(THREADS)
105 /* return this thread's dispatch pointer */
106 return (struct _glapi_table *) MesaGetTSD(&mesa_dispatch_tsd);
107 #else
108 return Dispatch;
109 #endif
110 }
111
112
113
114 /*
115 * Return size of dispatch table struct as number of functions (or
116 * slots).
117 */
118 GLuint
119 _glapi_get_dispatch_table_size(void)
120 {
121 return sizeof(struct _glapi_table) / sizeof(void *);
122 }
123
124
125
126 /*
127 * Get API dispatcher version string.
128 * XXX this isn't well defined yet.
129 */
130 const char *
131 _glapi_get_version(void)
132 {
133 return "1.2";
134 }
135
136
137 /*
138 * Return list of the hard-coded extension entrypoints in the dispatch table.
139 */
140 const char **
141 _glapi_get_extensions(void)
142 {
143 static const char *extensions[] = {
144 #ifdef _GLAPI_EXT_paletted_texture
145 "GL_EXT_paletted_texture",
146 #endif
147 #ifdef _GLAPI_EXT_compiled_vertex_array
148 "GL_EXT_compiled_vertex_array",
149 #endif
150 #ifdef _GLAPI_EXT_point_parameters
151 "GL_EXT_point_parameters",
152 #endif
153 #ifdef _GLAPI_EXT_polygon_offset
154 "GL_EXT_polygon_offset",
155 #endif
156 #ifdef _GLAPI_EXT_blend_minmax
157 "GL_EXT_blend_minmax",
158 #endif
159 #ifdef _GLAPI_EXT_blend_color
160 "GL_EXT_blend_color",
161 #endif
162 #ifdef _GLAPI_ARB_multitexture
163 "GL_ARB_multitexture",
164 #endif
165 #ifdef _GLAPI_INGR_blend_func_separate
166 "GL_INGR_blend_func_separate",
167 #endif
168 #ifdef _GLAPI_MESA_window_pos
169 "GL_MESA_window_pos",
170 #endif
171 #ifdef _GLAPI_MESA_resize_buffers
172 "GL_MESA_resize_buffers",
173 #endif
174 NULL
175 };
176
177 return extensions;
178 }
179
180
181
182 struct name_address_pair {
183 const char *Name;
184 GLvoid *Address;
185 };
186
187 static struct name_address_pair static_functions[] = {
188 { "glAccum", (GLvoid *) glAccum },
189 { "glAlphaFunc", (GLvoid *) glAlphaFunc },
190 { "glBegin", (GLvoid *) glBegin },
191 { "glBitmap", (GLvoid *) glBitmap },
192 { "glAccum", (GLvoid *) glAccum },
193 { "glAlphaFunc", (GLvoid *) glAlphaFunc },
194 { "glBegin", (GLvoid *) glBegin },
195 { "glBitmap", (GLvoid *) glBitmap },
196 { "glBlendFunc", (GLvoid *) glBlendFunc },
197 { "glCallList", (GLvoid *) glCallList },
198 { "glCallLists", (GLvoid *) glCallLists },
199 { "glClear", (GLvoid *) glClear },
200 { "glClearAccum", (GLvoid *) glClearAccum },
201 { "glClearColor", (GLvoid *) glClearColor },
202 { "glClearDepth", (GLvoid *) glClearDepth },
203 { "glClearIndex", (GLvoid *) glClearIndex },
204 { "glClearStencil", (GLvoid *) glClearStencil },
205 { "glClipPlane", (GLvoid *) glClipPlane },
206 { "glColor3b", (GLvoid *) glColor3b },
207 { "glColor3bv", (GLvoid *) glColor3bv },
208 { "glColor3d", (GLvoid *) glColor3d },
209 { "glColor3dv", (GLvoid *) glColor3dv },
210 { "glColor3f", (GLvoid *) glColor3f },
211 { "glColor3fv", (GLvoid *) glColor3fv },
212 { "glColor3i", (GLvoid *) glColor3i },
213 { "glColor3iv", (GLvoid *) glColor3iv },
214 { "glColor3s", (GLvoid *) glColor3s },
215 { "glColor3sv", (GLvoid *) glColor3sv },
216 { "glColor3ub", (GLvoid *) glColor3ub },
217 { "glColor3ubv", (GLvoid *) glColor3ubv },
218 { "glColor3ui", (GLvoid *) glColor3ui },
219 { "glColor3uiv", (GLvoid *) glColor3uiv },
220 { "glColor3us", (GLvoid *) glColor3us },
221 { "glColor3usv", (GLvoid *) glColor3usv },
222 { "glColor4b", (GLvoid *) glColor4b },
223 { "glColor4bv", (GLvoid *) glColor4bv },
224 { "glColor4d", (GLvoid *) glColor4d },
225 { "glColor4dv", (GLvoid *) glColor4dv },
226 { "glColor4f", (GLvoid *) glColor4f },
227 { "glColor4fv", (GLvoid *) glColor4fv },
228 { "glColor4i", (GLvoid *) glColor4i },
229 { "glColor4iv", (GLvoid *) glColor4iv },
230 { "glColor4s", (GLvoid *) glColor4s },
231 { "glColor4sv", (GLvoid *) glColor4sv },
232 { "glColor4ub", (GLvoid *) glColor4ub },
233 { "glColor4ubv", (GLvoid *) glColor4ubv },
234 { "glColor4ui", (GLvoid *) glColor4ui },
235 { "glColor4uiv", (GLvoid *) glColor4uiv },
236 { "glColor4us", (GLvoid *) glColor4us },
237 { "glColor4usv", (GLvoid *) glColor4usv },
238 { "glColorMask", (GLvoid *) glColorMask },
239 { "glColorMaterial", (GLvoid *) glColorMaterial },
240 { "glCopyPixels", (GLvoid *) glCopyPixels },
241 { "glCullFace", (GLvoid *) glCullFace },
242 { "glDeleteLists", (GLvoid *) glDeleteLists },
243 { "glDepthFunc", (GLvoid *) glDepthFunc },
244 { "glDepthMask", (GLvoid *) glDepthMask },
245 { "glDepthRange", (GLvoid *) glDepthRange },
246 { "glDisable", (GLvoid *) glDisable },
247 { "glDrawBuffer", (GLvoid *) glDrawBuffer },
248 { "glDrawPixels", (GLvoid *) glDrawPixels },
249 { "glEdgeFlag", (GLvoid *) glEdgeFlag },
250 { "glEdgeFlagv", (GLvoid *) glEdgeFlagv },
251 { "glEnable", (GLvoid *) glEnable },
252 { "glEnd", (GLvoid *) glEnd },
253 { "glEndList", (GLvoid *) glEndList },
254 { "glEvalCoord1d", (GLvoid *) glEvalCoord1d },
255 { "glEvalCoord1dv", (GLvoid *) glEvalCoord1dv },
256 { "glEvalCoord1f", (GLvoid *) glEvalCoord1f },
257 { "glEvalCoord1fv", (GLvoid *) glEvalCoord1fv },
258 { "glEvalCoord2d", (GLvoid *) glEvalCoord2d },
259 { "glEvalCoord2dv", (GLvoid *) glEvalCoord2dv },
260 { "glEvalCoord2f", (GLvoid *) glEvalCoord2f },
261 { "glEvalCoord2fv", (GLvoid *) glEvalCoord2fv },
262 { "glEvalMesh1", (GLvoid *) glEvalMesh1 },
263 { "glEvalMesh2", (GLvoid *) glEvalMesh2 },
264 { "glEvalPoint1", (GLvoid *) glEvalPoint1 },
265 { "glEvalPoint2", (GLvoid *) glEvalPoint2 },
266 { "glFeedbackBuffer", (GLvoid *) glFeedbackBuffer },
267 { "glFinish", (GLvoid *) glFinish },
268 { "glFlush", (GLvoid *) glFlush },
269 { "glFogf", (GLvoid *) glFogf },
270 { "glFogfv", (GLvoid *) glFogfv },
271 { "glFogi", (GLvoid *) glFogi },
272 { "glFogiv", (GLvoid *) glFogiv },
273 { "glFrontFace", (GLvoid *) glFrontFace },
274 { "glFrustum", (GLvoid *) glFrustum },
275 { "glGenLists", (GLvoid *) glGenLists },
276 { "glGetBooleanv", (GLvoid *) glGetBooleanv },
277 { "glGetClipPlane", (GLvoid *) glGetClipPlane },
278 { "glGetDoublev", (GLvoid *) glGetDoublev },
279 { "glGetError", (GLvoid *) glGetError },
280 { "glGetFloatv", (GLvoid *) glGetFloatv },
281 { "glGetIntegerv", (GLvoid *) glGetIntegerv },
282 { "glGetLightfv", (GLvoid *) glGetLightfv },
283 { "glGetLightiv", (GLvoid *) glGetLightiv },
284 { "glGetMapdv", (GLvoid *) glGetMapdv },
285 { "glGetMapfv", (GLvoid *) glGetMapfv },
286 { "glGetMapiv", (GLvoid *) glGetMapiv },
287 { "glGetMaterialfv", (GLvoid *) glGetMaterialfv },
288 { "glGetMaterialiv", (GLvoid *) glGetMaterialiv },
289 { "glGetPixelMapfv", (GLvoid *) glGetPixelMapfv },
290 { "glGetPixelMapuiv", (GLvoid *) glGetPixelMapuiv },
291 { "glGetPixelMapusv", (GLvoid *) glGetPixelMapusv },
292 { "glGetPolygonStipple", (GLvoid *) glGetPolygonStipple },
293 { "glGetString", (GLvoid *) glGetString },
294 { "glGetTexEnvfv", (GLvoid *) glGetTexEnvfv },
295 { "glGetTexEnviv", (GLvoid *) glGetTexEnviv },
296 { "glGetTexGendv", (GLvoid *) glGetTexGendv },
297 { "glGetTexGenfv", (GLvoid *) glGetTexGenfv },
298 { "glGetTexGeniv", (GLvoid *) glGetTexGeniv },
299 { "glGetTexImage", (GLvoid *) glGetTexImage },
300 { "glGetTexLevelParameterfv", (GLvoid *) glGetTexLevelParameterfv },
301 { "glGetTexLevelParameteriv", (GLvoid *) glGetTexLevelParameteriv },
302 { "glGetTexParameterfv", (GLvoid *) glGetTexParameterfv },
303 { "glGetTexParameteriv", (GLvoid *) glGetTexParameteriv },
304 { "glHint", (GLvoid *) glHint },
305 { "glIndexMask", (GLvoid *) glIndexMask },
306 { "glIndexd", (GLvoid *) glIndexd },
307 { "glIndexdv", (GLvoid *) glIndexdv },
308 { "glIndexf", (GLvoid *) glIndexf },
309 { "glIndexfv", (GLvoid *) glIndexfv },
310 { "glIndexi", (GLvoid *) glIndexi },
311 { "glIndexiv", (GLvoid *) glIndexiv },
312 { "glIndexs", (GLvoid *) glIndexs },
313 { "glIndexsv", (GLvoid *) glIndexsv },
314 { "glInitNames", (GLvoid *) glInitNames },
315 { "glIsEnabled", (GLvoid *) glIsEnabled },
316 { "glIsList", (GLvoid *) glIsList },
317 { "glLightModelf", (GLvoid *) glLightModelf },
318 { "glLightModelfv", (GLvoid *) glLightModelfv },
319 { "glLightModeli", (GLvoid *) glLightModeli },
320 { "glLightModeliv", (GLvoid *) glLightModeliv },
321 { "glLightf", (GLvoid *) glLightf },
322 { "glLightfv", (GLvoid *) glLightfv },
323 { "glLighti", (GLvoid *) glLighti },
324 { "glLightiv", (GLvoid *) glLightiv },
325 { "glLineStipple", (GLvoid *) glLineStipple },
326 { "glLineWidth", (GLvoid *) glLineWidth },
327 { "glListBase", (GLvoid *) glListBase },
328 { "glLoadIdentity", (GLvoid *) glLoadIdentity },
329 { "glLoadMatrixd", (GLvoid *) glLoadMatrixd },
330 { "glLoadMatrixf", (GLvoid *) glLoadMatrixf },
331 { "glLoadName", (GLvoid *) glLoadName },
332 { "glLogicOp", (GLvoid *) glLogicOp },
333 { "glMap1d", (GLvoid *) glMap1d },
334 { "glMap1f", (GLvoid *) glMap1f },
335 { "glMap2d", (GLvoid *) glMap2d },
336 { "glMap2f", (GLvoid *) glMap2f },
337 { "glMapGrid1d", (GLvoid *) glMapGrid1d },
338 { "glMapGrid1f", (GLvoid *) glMapGrid1f },
339 { "glMapGrid2d", (GLvoid *) glMapGrid2d },
340 { "glMapGrid2f", (GLvoid *) glMapGrid2f },
341 { "glMaterialf", (GLvoid *) glMaterialf },
342 { "glMaterialfv", (GLvoid *) glMaterialfv },
343 { "glMateriali", (GLvoid *) glMateriali },
344 { "glMaterialiv", (GLvoid *) glMaterialiv },
345 { "glMatrixMode", (GLvoid *) glMatrixMode },
346 { "glMultMatrixd", (GLvoid *) glMultMatrixd },
347 { "glMultMatrixf", (GLvoid *) glMultMatrixf },
348 { "glNewList", (GLvoid *) glNewList },
349 { "glNormal3b", (GLvoid *) glNormal3b },
350 { "glNormal3bv", (GLvoid *) glNormal3bv },
351 { "glNormal3d", (GLvoid *) glNormal3d },
352 { "glNormal3dv", (GLvoid *) glNormal3dv },
353 { "glNormal3f", (GLvoid *) glNormal3f },
354 { "glNormal3fv", (GLvoid *) glNormal3fv },
355 { "glNormal3i", (GLvoid *) glNormal3i },
356 { "glNormal3iv", (GLvoid *) glNormal3iv },
357 { "glNormal3s", (GLvoid *) glNormal3s },
358 { "glNormal3sv", (GLvoid *) glNormal3sv },
359 { "glOrtho", (GLvoid *) glOrtho },
360 { "glPassThrough", (GLvoid *) glPassThrough },
361 { "glPixelMapfv", (GLvoid *) glPixelMapfv },
362 { "glPixelMapuiv", (GLvoid *) glPixelMapuiv },
363 { "glPixelMapusv", (GLvoid *) glPixelMapusv },
364 { "glPixelStoref", (GLvoid *) glPixelStoref },
365 { "glPixelStorei", (GLvoid *) glPixelStorei },
366 { "glPixelTransferf", (GLvoid *) glPixelTransferf },
367 { "glPixelTransferi", (GLvoid *) glPixelTransferi },
368 { "glPixelZoom", (GLvoid *) glPixelZoom },
369 { "glPointSize", (GLvoid *) glPointSize },
370 { "glPolygonMode", (GLvoid *) glPolygonMode },
371 { "glPolygonOffset", (GLvoid *) glPolygonOffset },
372 { "glPolygonStipple", (GLvoid *) glPolygonStipple },
373 { "glPopAttrib", (GLvoid *) glPopAttrib },
374 { "glPopMatrix", (GLvoid *) glPopMatrix },
375 { "glPopName", (GLvoid *) glPopName },
376 { "glPushAttrib", (GLvoid *) glPushAttrib },
377 { "glPushMatrix", (GLvoid *) glPushMatrix },
378 { "glPushName", (GLvoid *) glPushName },
379 { "glRasterPos2d", (GLvoid *) glRasterPos2d },
380 { "glRasterPos2dv", (GLvoid *) glRasterPos2dv },
381 { "glRasterPos2f", (GLvoid *) glRasterPos2f },
382 { "glRasterPos2fv", (GLvoid *) glRasterPos2fv },
383 { "glRasterPos2i", (GLvoid *) glRasterPos2i },
384 { "glRasterPos2iv", (GLvoid *) glRasterPos2iv },
385 { "glRasterPos2s", (GLvoid *) glRasterPos2s },
386 { "glRasterPos2sv", (GLvoid *) glRasterPos2sv },
387 { "glRasterPos3d", (GLvoid *) glRasterPos3d },
388 { "glRasterPos3dv", (GLvoid *) glRasterPos3dv },
389 { "glRasterPos3f", (GLvoid *) glRasterPos3f },
390 { "glRasterPos3fv", (GLvoid *) glRasterPos3fv },
391 { "glRasterPos3i", (GLvoid *) glRasterPos3i },
392 { "glRasterPos3iv", (GLvoid *) glRasterPos3iv },
393 { "glRasterPos3s", (GLvoid *) glRasterPos3s },
394 { "glRasterPos3sv", (GLvoid *) glRasterPos3sv },
395 { "glRasterPos4d", (GLvoid *) glRasterPos4d },
396 { "glRasterPos4dv", (GLvoid *) glRasterPos4dv },
397 { "glRasterPos4f", (GLvoid *) glRasterPos4f },
398 { "glRasterPos4fv", (GLvoid *) glRasterPos4fv },
399 { "glRasterPos4i", (GLvoid *) glRasterPos4i },
400 { "glRasterPos4iv", (GLvoid *) glRasterPos4iv },
401 { "glRasterPos4s", (GLvoid *) glRasterPos4s },
402 { "glRasterPos4sv", (GLvoid *) glRasterPos4sv },
403 { "glReadBuffer", (GLvoid *) glReadBuffer },
404 { "glReadPixels", (GLvoid *) glReadPixels },
405 { "glRectd", (GLvoid *) glRectd },
406 { "glRectdv", (GLvoid *) glRectdv },
407 { "glRectf", (GLvoid *) glRectf },
408 { "glRectfv", (GLvoid *) glRectfv },
409 { "glRecti", (GLvoid *) glRecti },
410 { "glRectiv", (GLvoid *) glRectiv },
411 { "glRects", (GLvoid *) glRects },
412 { "glRectsv", (GLvoid *) glRectsv },
413 { "glRenderMode", (GLvoid *) glRenderMode },
414 { "glRotated", (GLvoid *) glRotated },
415 { "glRotatef", (GLvoid *) glRotatef },
416 { "glScaled", (GLvoid *) glScaled },
417 { "glScalef", (GLvoid *) glScalef },
418 { "glScissor", (GLvoid *) glScissor },
419 { "glSelectBuffer", (GLvoid *) glSelectBuffer },
420 { "glShadeModel", (GLvoid *) glShadeModel },
421 { "glStencilFunc", (GLvoid *) glStencilFunc },
422 { "glStencilMask", (GLvoid *) glStencilMask },
423 { "glStencilOp", (GLvoid *) glStencilOp },
424 { "glTexCoord1d", (GLvoid *) glTexCoord1d },
425 { "glTexCoord1dv", (GLvoid *) glTexCoord1dv },
426 { "glTexCoord1f", (GLvoid *) glTexCoord1f },
427 { "glTexCoord1fv", (GLvoid *) glTexCoord1fv },
428 { "glTexCoord1i", (GLvoid *) glTexCoord1i },
429 { "glTexCoord1iv", (GLvoid *) glTexCoord1iv },
430 { "glTexCoord1s", (GLvoid *) glTexCoord1s },
431 { "glTexCoord1sv", (GLvoid *) glTexCoord1sv },
432 { "glTexCoord2d", (GLvoid *) glTexCoord2d },
433 { "glTexCoord2dv", (GLvoid *) glTexCoord2dv },
434 { "glTexCoord2f", (GLvoid *) glTexCoord2f },
435 { "glTexCoord2fv", (GLvoid *) glTexCoord2fv },
436 { "glTexCoord2i", (GLvoid *) glTexCoord2i },
437 { "glTexCoord2iv", (GLvoid *) glTexCoord2iv },
438 { "glTexCoord2s", (GLvoid *) glTexCoord2s },
439 { "glTexCoord2sv", (GLvoid *) glTexCoord2sv },
440 { "glTexCoord3d", (GLvoid *) glTexCoord3d },
441 { "glTexCoord3dv", (GLvoid *) glTexCoord3dv },
442 { "glTexCoord3f", (GLvoid *) glTexCoord3f },
443 { "glTexCoord3fv", (GLvoid *) glTexCoord3fv },
444 { "glTexCoord3i", (GLvoid *) glTexCoord3i },
445 { "glTexCoord3iv", (GLvoid *) glTexCoord3iv },
446 { "glTexCoord3s", (GLvoid *) glTexCoord3s },
447 { "glTexCoord3sv", (GLvoid *) glTexCoord3sv },
448 { "glTexCoord4d", (GLvoid *) glTexCoord4d },
449 { "glTexCoord4dv", (GLvoid *) glTexCoord4dv },
450 { "glTexCoord4f", (GLvoid *) glTexCoord4f },
451 { "glTexCoord4fv", (GLvoid *) glTexCoord4fv },
452 { "glTexCoord4i", (GLvoid *) glTexCoord4i },
453 { "glTexCoord4iv", (GLvoid *) glTexCoord4iv },
454 { "glTexCoord4s", (GLvoid *) glTexCoord4s },
455 { "glTexCoord4sv", (GLvoid *) glTexCoord4sv },
456 { "glTexEnvf", (GLvoid *) glTexEnvf },
457 { "glTexEnvfv", (GLvoid *) glTexEnvfv },
458 { "glTexEnvi", (GLvoid *) glTexEnvi },
459 { "glTexEnviv", (GLvoid *) glTexEnviv },
460 { "glTexGend", (GLvoid *) glTexGend },
461 { "glTexGendv", (GLvoid *) glTexGendv },
462 { "glTexGenf", (GLvoid *) glTexGenf },
463 { "glTexGenfv", (GLvoid *) glTexGenfv },
464 { "glTexGeni", (GLvoid *) glTexGeni },
465 { "glTexGeniv", (GLvoid *) glTexGeniv },
466 { "glTexImage1D", (GLvoid *) glTexImage1D },
467 { "glTexImage2D", (GLvoid *) glTexImage2D },
468 { "glTexParameterf", (GLvoid *) glTexParameterf },
469 { "glTexParameterfv", (GLvoid *) glTexParameterfv },
470 { "glTexParameteri", (GLvoid *) glTexParameteri },
471 { "glTexParameteriv", (GLvoid *) glTexParameteriv },
472 { "glTranslated", (GLvoid *) glTranslated },
473 { "glTranslatef", (GLvoid *) glTranslatef },
474 { "glVertex2d", (GLvoid *) glVertex2d },
475 { "glVertex2dv", (GLvoid *) glVertex2dv },
476 { "glVertex2f", (GLvoid *) glVertex2f },
477 { "glVertex2fv", (GLvoid *) glVertex2fv },
478 { "glVertex2i", (GLvoid *) glVertex2i },
479 { "glVertex2iv", (GLvoid *) glVertex2iv },
480 { "glVertex2s", (GLvoid *) glVertex2s },
481 { "glVertex2sv", (GLvoid *) glVertex2sv },
482 { "glVertex3d", (GLvoid *) glVertex3d },
483 { "glVertex3dv", (GLvoid *) glVertex3dv },
484 { "glVertex3f", (GLvoid *) glVertex3f },
485 { "glVertex3fv", (GLvoid *) glVertex3fv },
486 { "glVertex3i", (GLvoid *) glVertex3i },
487 { "glVertex3iv", (GLvoid *) glVertex3iv },
488 { "glVertex3s", (GLvoid *) glVertex3s },
489 { "glVertex3sv", (GLvoid *) glVertex3sv },
490 { "glVertex4d", (GLvoid *) glVertex4d },
491 { "glVertex4dv", (GLvoid *) glVertex4dv },
492 { "glVertex4f", (GLvoid *) glVertex4f },
493 { "glVertex4fv", (GLvoid *) glVertex4fv },
494 { "glVertex4i", (GLvoid *) glVertex4i },
495 { "glVertex4iv", (GLvoid *) glVertex4iv },
496 { "glVertex4s", (GLvoid *) glVertex4s },
497 { "glVertex4sv", (GLvoid *) glVertex4sv },
498 { "glViewport", (GLvoid *) glViewport },
499
500 #ifdef _GLAPI_VERSION_1_1
501 { "glAreTexturesResident", (GLvoid *) glAreTexturesResident },
502 { "glArrayElement", (GLvoid *) glArrayElement },
503 { "glBindTexture", (GLvoid *) glBindTexture },
504 { "glColorPointer", (GLvoid *) glColorPointer },
505 { "glCopyTexImage1D", (GLvoid *) glCopyTexImage1D },
506 { "glCopyTexImage2D", (GLvoid *) glCopyTexImage2D },
507 { "glCopyTexSubImage1D", (GLvoid *) glCopyTexSubImage1D },
508 { "glCopyTexSubImage2D", (GLvoid *) glCopyTexSubImage2D },
509 { "glDeleteTextures", (GLvoid *) glDeleteTextures },
510 { "glDisableClientState", (GLvoid *) glDisableClientState },
511 { "glDrawArrays", (GLvoid *) glDrawArrays },
512 { "glDrawElements", (GLvoid *) glDrawElements },
513 { "glEdgeFlagPointer", (GLvoid *) glEdgeFlagPointer },
514 { "glEnableClientState", (GLvoid *) glEnableClientState },
515 { "glGenTextures", (GLvoid *) glGenTextures },
516 { "glGetPointerv", (GLvoid *) glGetPointerv },
517 { "glIndexPointer", (GLvoid *) glIndexPointer },
518 { "glIndexub", (GLvoid *) glIndexub },
519 { "glIndexubv", (GLvoid *) glIndexubv },
520 { "glInterleavedArrays", (GLvoid *) glInterleavedArrays },
521 { "glIsTexture", (GLvoid *) glIsTexture },
522 { "glNormalPointer", (GLvoid *) glNormalPointer },
523 { "glPopClientAttrib", (GLvoid *) glPopClientAttrib },
524 { "glPrioritizeTextures", (GLvoid *) glPrioritizeTextures },
525 { "glPushClientAttrib", (GLvoid *) glPushClientAttrib },
526 { "glTexCoordPointer", (GLvoid *) glTexCoordPointer },
527 { "glTexSubImage1D", (GLvoid *) glTexSubImage1D },
528 { "glTexSubImage2D", (GLvoid *) glTexSubImage2D },
529 { "glVertexPointer", (GLvoid *) glVertexPointer },
530 #endif
531
532 #ifdef _GLAPI_VERSION_1_2
533 { "glCopyTexSubImage3D", (GLvoid *) glCopyTexSubImage3D },
534 { "glDrawRangeElements", (GLvoid *) glDrawRangeElements },
535 { "glTexImage3D", (GLvoid *) glTexImage3D },
536 { "glTexSubImage3D", (GLvoid *) glTexSubImage3D },
537
538 #ifdef _GLAPI_ARB_imaging
539 { "glBlendColor", (GLvoid *) glBlendColor },
540 { "glBlendEquation", (GLvoid *) glBlendEquation },
541 { "glColorSubTable", (GLvoid *) glColorSubTable },
542 { "glColorTable", (GLvoid *) glColorTable },
543 { "glColorTableParameterfv", (GLvoid *) glColorTableParameterfv },
544 { "glColorTableParameteriv", (GLvoid *) glColorTableParameteriv },
545 { "glConvolutionFilter1D", (GLvoid *) glConvolutionFilter1D },
546 { "glConvolutionFilter2D", (GLvoid *) glConvolutionFilter2D },
547 { "glConvolutionParameterf", (GLvoid *) glConvolutionParameterf },
548 { "glConvolutionParameterfv", (GLvoid *) glConvolutionParameterfv },
549 { "glConvolutionParameteri", (GLvoid *) glConvolutionParameteri },
550 { "glConvolutionParameteriv", (GLvoid *) glConvolutionParameteriv },
551 { "glCopyColorSubTable", (GLvoid *) glCopyColorSubTable },
552 { "glCopyColorTable", (GLvoid *) glCopyColorTable },
553 { "glCopyConvolutionFilter1D", (GLvoid *) glCopyConvolutionFilter1D },
554 { "glCopyConvolutionFilter2D", (GLvoid *) glCopyConvolutionFilter2D },
555 { "glGetColorTable", (GLvoid *) glGetColorTable },
556 { "glGetColorTableParameterfv", (GLvoid *) glGetColorTableParameterfv },
557 { "glGetColorTableParameteriv", (GLvoid *) glGetColorTableParameteriv },
558 { "glGetConvolutionFilter", (GLvoid *) glGetConvolutionFilter },
559 { "glGetConvolutionParameterfv", (GLvoid *) glGetConvolutionParameterfv },
560 { "glGetConvolutionParameteriv", (GLvoid *) glGetConvolutionParameteriv },
561 { "glGetHistogram", (GLvoid *) glGetHistogram },
562 { "glGetHistogramParameterfv", (GLvoid *) glGetHistogramParameterfv },
563 { "glGetHistogramParameteriv", (GLvoid *) glGetHistogramParameteriv },
564 { "glGetMinmax", (GLvoid *) glGetMinmax },
565 { "glGetMinmaxParameterfv", (GLvoid *) glGetMinmaxParameterfv },
566 { "glGetMinmaxParameteriv", (GLvoid *) glGetMinmaxParameteriv },
567 { "glGetSeparableFilter", (GLvoid *) glGetSeparableFilter },
568 { "glHistogram", (GLvoid *) glHistogram },
569 { "glMinmax", (GLvoid *) glMinmax },
570 { "glResetHistogram", (GLvoid *) glResetHistogram },
571 { "glResetMinmax", (GLvoid *) glResetMinmax },
572 { "glSeparableFilter2D", (GLvoid *) glSeparableFilter2D },
573 #endif
574 #endif
575
576 #ifdef _GLAPI_EXT_paletted_texture
577 { "glColorTableEXT", (GLvoid *) glColorTableEXT },
578 { "glColorSubTableEXT", (GLvoid *) glColorSubTableEXT },
579 { "glGetColorTableEXT", (GLvoid *) glGetColorTableEXT },
580 { "glGetColorTableParameterfvEXT", (GLvoid *) glGetColorTableParameterfvEXT },
581 { "glGetColorTableParameterivEXT", (GLvoid *) glGetColorTableParameterivEXT },
582 #endif
583
584 #ifdef _GLAPI_EXT_compiled_vertex_array
585 { "glLockArraysEXT", (GLvoid *) glLockArraysEXT },
586 { "glUnlockArraysEXT", (GLvoid *) glUnlockArraysEXT },
587 #endif
588
589 #ifdef _GLAPI_EXT_point_parameters
590 { "glPointParameterfEXT", (GLvoid *) glPointParameterfEXT },
591 { "glPointParameterfvEXT", (GLvoid *) glPointParameterfvEXT },
592 #endif
593
594 #ifdef _GLAPI_EXT_polygon_offset
595 { "glPolygonOffsetEXT", (GLvoid *) glPolygonOffsetEXT },
596 #endif
597
598 #ifdef _GLAPI_EXT_blend_minmax
599 { "glBlendEquationEXT", (GLvoid *) glBlendEquationEXT },
600 #endif
601
602 #ifdef _GLAPI_EXT_blend_color
603 { "glBlendColorEXT", (GLvoid *) glBlendColorEXT },
604 #endif
605
606 #ifdef _GLAPI_ARB_multitexture
607 { "glActiveTextureARB", (GLvoid *) glActiveTextureARB },
608 { "glClientActiveTextureARB", (GLvoid *) glClientActiveTextureARB },
609 { "glMultiTexCoord1dARB", (GLvoid *) glMultiTexCoord1dARB },
610 { "glMultiTexCoord1dvARB", (GLvoid *) glMultiTexCoord1dvARB },
611 { "glMultiTexCoord1fARB", (GLvoid *) glMultiTexCoord1fARB },
612 { "glMultiTexCoord1fvARB", (GLvoid *) glMultiTexCoord1fvARB },
613 { "glMultiTexCoord1iARB", (GLvoid *) glMultiTexCoord1iARB },
614 { "glMultiTexCoord1ivARB", (GLvoid *) glMultiTexCoord1ivARB },
615 { "glMultiTexCoord1sARB", (GLvoid *) glMultiTexCoord1sARB },
616 { "glMultiTexCoord1svARB", (GLvoid *) glMultiTexCoord1svARB },
617 { "glMultiTexCoord2dARB", (GLvoid *) glMultiTexCoord2dARB },
618 { "glMultiTexCoord2dvARB", (GLvoid *) glMultiTexCoord2dvARB },
619 { "glMultiTexCoord2fARB", (GLvoid *) glMultiTexCoord2fARB },
620 { "glMultiTexCoord2fvARB", (GLvoid *) glMultiTexCoord2fvARB },
621 { "glMultiTexCoord2iARB", (GLvoid *) glMultiTexCoord2iARB },
622 { "glMultiTexCoord2ivARB", (GLvoid *) glMultiTexCoord2ivARB },
623 { "glMultiTexCoord2sARB", (GLvoid *) glMultiTexCoord2sARB },
624 { "glMultiTexCoord2svARB", (GLvoid *) glMultiTexCoord2svARB },
625 { "glMultiTexCoord3dARB", (GLvoid *) glMultiTexCoord3dARB },
626 { "glMultiTexCoord3dvARB", (GLvoid *) glMultiTexCoord3dvARB },
627 { "glMultiTexCoord3fARB", (GLvoid *) glMultiTexCoord3fARB },
628 { "glMultiTexCoord3fvARB", (GLvoid *) glMultiTexCoord3fvARB },
629 { "glMultiTexCoord3iARB", (GLvoid *) glMultiTexCoord3iARB },
630 { "glMultiTexCoord3ivARB", (GLvoid *) glMultiTexCoord3ivARB },
631 { "glMultiTexCoord3sARB", (GLvoid *) glMultiTexCoord3sARB },
632 { "glMultiTexCoord3svARB", (GLvoid *) glMultiTexCoord3svARB },
633 { "glMultiTexCoord4dARB", (GLvoid *) glMultiTexCoord4dARB },
634 { "glMultiTexCoord4dvARB", (GLvoid *) glMultiTexCoord4dvARB },
635 { "glMultiTexCoord4fARB", (GLvoid *) glMultiTexCoord4fARB },
636 { "glMultiTexCoord4fvARB", (GLvoid *) glMultiTexCoord4fvARB },
637 { "glMultiTexCoord4iARB", (GLvoid *) glMultiTexCoord4iARB },
638 { "glMultiTexCoord4ivARB", (GLvoid *) glMultiTexCoord4ivARB },
639 { "glMultiTexCoord4sARB", (GLvoid *) glMultiTexCoord4sARB },
640 { "glMultiTexCoord4svARB", (GLvoid *) glMultiTexCoord4svARB },
641 #endif
642
643 #ifdef _GLAPI_INGR_blend_func_separate
644 { "glBlendFuncSeparateINGR", (GLvoid *) glBlendFuncSeparateINGR },
645 #endif
646
647 #ifdef _GLAPI_MESA_window_pos
648 { "glWindowPos4fMESA", (GLvoid *) glWindowPos4fMESA },
649 #endif
650
651 #ifdef _GLAPI_MESA_resize_buffers
652 { "glResizeBuffersMESA", (GLvoid *) glResizeBuffersMESA },
653 #endif
654
655 { NULL, NULL } /* end of list marker */
656 };
657
658
659
660 /*
661 * Return dispatch table offset of the named static (built-in) function.
662 * Return -1 if function not found.
663 */
664 static GLint
665 get_static_proc_offset(const char *funcName)
666 {
667 GLuint i;
668 for (i = 0; static_functions[i].Name; i++) {
669 if (strcmp(static_functions[i].Name, funcName) == 0) {
670 return i;
671 }
672 }
673 return -1;
674 }
675
676
677 /*
678 * Return dispatch function address the named static (built-in) function.
679 * Return NULL if function not found.
680 */
681 static GLvoid *
682 get_static_proc_address(const char *funcName)
683 {
684 GLuint i = get_static_proc_offset(funcName);
685 if (i >= 0)
686 return static_functions[i].Address;
687 else
688 return NULL;
689 }
690
691
692
693 /**********************************************************************
694 * Extension function management.
695 **********************************************************************/
696
697
698 struct _glapi_ext_entrypoint {
699 const char *Name; /* the extension function's name */
700 GLuint Offset; /* relative to start of dispatch table */
701 GLvoid *Address; /* address of dispatch function */
702 };
703
704 static struct _glapi_ext_entrypoint ExtEntryTable[_GLAPI_EXTRA_SLOTS];
705 static GLuint NumExtEntryPoints = 0;
706
707
708
709 /*
710 * Generate a dispatch function (entrypoint) which jumps through
711 * the given slot number (offset) in the current dispatch table.
712 */
713 static void *
714 generate_entrypoint(GLuint offset)
715 {
716 /* XXX need to generate some assembly code here */
717
718 return NULL;
719 }
720
721
722
723 /*
724 * Add a new extension function entrypoint.
725 * Return: GL_TRUE = success or GL_FALSE = failure
726 */
727 GLboolean
728 _glapi_add_entrypoint(const char *funcName, GLuint offset)
729 {
730 /* first check if the named function is already statically present */
731 GLint index = get_static_proc_offset(funcName);
732 if (index >= 0) {
733 assert(index == offset);
734 return GL_TRUE;
735 }
736 else if (offset < _glapi_get_dispatch_table_size()) {
737 /* be sure index and name match known data */
738 GLuint i;
739 for (i = 0; i < NumExtEntryPoints; i++) {
740 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
741 /* function already registered with api */
742 if (ExtEntryTable[i].Offset == offset) {
743 return GL_TRUE; /* offsets match */
744 }
745 else {
746 return GL_FALSE; /* bad offset! */
747 }
748 }
749 }
750 assert(NumExtEntryPoints < _GLAPI_EXTRA_SLOTS);
751 ExtEntryTable[NumExtEntryPoints].Name = strdup(funcName);
752 ExtEntryTable[NumExtEntryPoints].Offset = offset;
753 ExtEntryTable[NumExtEntryPoints].Address = generate_entrypoint(offset);
754 NumExtEntryPoints++;
755 return GL_TRUE;
756 }
757 else {
758 return GL_FALSE;
759 }
760 }
761
762
763
764 /*
765 * Return offset of entrypoint for named function within dispatch table.
766 */
767 GLint
768 _glapi_get_proc_offset(const char *funcName)
769 {
770 /* search extension functions first */
771 GLint i;
772 for (i = 0; i < NumExtEntryPoints; i++) {
773 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
774 return ExtEntryTable[i].Offset;
775 }
776 }
777
778 /* search static functions */
779 return get_static_proc_offset(funcName);
780 }
781
782
783
784 /*
785 * Return entrypoint for named function.
786 */
787 const GLvoid *
788 _glapi_get_proc_address(const char *funcName)
789 {
790 /* search extension functions first */
791 GLint i;
792 for (i = 0; i < NumExtEntryPoints; i++) {
793 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
794 return ExtEntryTable[i].Address;
795 }
796 }
797
798 /* search static functions */
799 return get_static_proc_address(funcName);
800 }
801
802
803
804 /*
805 * Make sure there are no NULL pointers in the given dispatch table.
806 * Intented for debugging purposes.
807 */
808 void
809 _glapi_check_table(const struct _glapi_table *table)
810 {
811 assert(table->Accum);
812 assert(table->AlphaFunc);
813 assert(table->Begin);
814 assert(table->Bitmap);
815 assert(table->BlendFunc);
816 assert(table->CallList);
817 assert(table->CallLists);
818 assert(table->Clear);
819 assert(table->ClearAccum);
820 assert(table->ClearColor);
821 assert(table->ClearDepth);
822 assert(table->ClearIndex);
823 assert(table->ClearStencil);
824 assert(table->ClipPlane);
825 assert(table->Color3b);
826 assert(table->Color3bv);
827 assert(table->Color3d);
828 assert(table->Color3dv);
829 assert(table->Color3f);
830 assert(table->Color3fv);
831 assert(table->Color3i);
832 assert(table->Color3iv);
833 assert(table->Color3s);
834 assert(table->Color3sv);
835 assert(table->Color3ub);
836 assert(table->Color3ubv);
837 assert(table->Color3ui);
838 assert(table->Color3uiv);
839 assert(table->Color3us);
840 assert(table->Color3usv);
841 assert(table->Color4b);
842 assert(table->Color4bv);
843 assert(table->Color4d);
844 assert(table->Color4dv);
845 assert(table->Color4f);
846 assert(table->Color4fv);
847 assert(table->Color4i);
848 assert(table->Color4iv);
849 assert(table->Color4s);
850 assert(table->Color4sv);
851 assert(table->Color4ub);
852 assert(table->Color4ubv);
853 assert(table->Color4ui);
854 assert(table->Color4uiv);
855 assert(table->Color4us);
856 assert(table->Color4usv);
857 assert(table->ColorMask);
858 assert(table->ColorMaterial);
859 assert(table->CopyPixels);
860 assert(table->CullFace);
861 assert(table->DeleteLists);
862 assert(table->DepthFunc);
863 assert(table->DepthMask);
864 assert(table->DepthRange);
865 assert(table->Disable);
866 assert(table->DrawBuffer);
867 assert(table->DrawElements);
868 assert(table->DrawPixels);
869 assert(table->EdgeFlag);
870 assert(table->EdgeFlagv);
871 assert(table->Enable);
872 assert(table->End);
873 assert(table->EndList);
874 assert(table->EvalCoord1d);
875 assert(table->EvalCoord1dv);
876 assert(table->EvalCoord1f);
877 assert(table->EvalCoord1fv);
878 assert(table->EvalCoord2d);
879 assert(table->EvalCoord2dv);
880 assert(table->EvalCoord2f);
881 assert(table->EvalCoord2fv);
882 assert(table->EvalMesh1);
883 assert(table->EvalMesh2);
884 assert(table->EvalPoint1);
885 assert(table->EvalPoint2);
886 assert(table->FeedbackBuffer);
887 assert(table->Finish);
888 assert(table->Flush);
889 assert(table->Fogf);
890 assert(table->Fogfv);
891 assert(table->Fogi);
892 assert(table->Fogiv);
893 assert(table->FrontFace);
894 assert(table->Frustum);
895 assert(table->GenLists);
896 assert(table->GetBooleanv);
897 assert(table->GetClipPlane);
898 assert(table->GetDoublev);
899 assert(table->GetError);
900 assert(table->GetFloatv);
901 assert(table->GetIntegerv);
902 assert(table->GetLightfv);
903 assert(table->GetLightiv);
904 assert(table->GetMapdv);
905 assert(table->GetMapfv);
906 assert(table->GetMapiv);
907 assert(table->GetMaterialfv);
908 assert(table->GetMaterialiv);
909 assert(table->GetPixelMapfv);
910 assert(table->GetPixelMapuiv);
911 assert(table->GetPixelMapusv);
912 assert(table->GetPolygonStipple);
913 assert(table->GetString);
914 assert(table->GetTexEnvfv);
915 assert(table->GetTexEnviv);
916 assert(table->GetTexGendv);
917 assert(table->GetTexGenfv);
918 assert(table->GetTexGeniv);
919 assert(table->GetTexImage);
920 assert(table->GetTexLevelParameterfv);
921 assert(table->GetTexLevelParameteriv);
922 assert(table->GetTexParameterfv);
923 assert(table->GetTexParameteriv);
924 assert(table->Hint);
925 assert(table->IndexMask);
926 assert(table->Indexd);
927 assert(table->Indexdv);
928 assert(table->Indexf);
929 assert(table->Indexfv);
930 assert(table->Indexi);
931 assert(table->Indexiv);
932 assert(table->Indexs);
933 assert(table->Indexsv);
934 assert(table->InitNames);
935 assert(table->IsEnabled);
936 assert(table->IsList);
937 assert(table->LightModelf);
938 assert(table->LightModelfv);
939 assert(table->LightModeli);
940 assert(table->LightModeliv);
941 assert(table->Lightf);
942 assert(table->Lightfv);
943 assert(table->Lighti);
944 assert(table->Lightiv);
945 assert(table->LineStipple);
946 assert(table->LineWidth);
947 assert(table->ListBase);
948 assert(table->LoadIdentity);
949 assert(table->LoadMatrixd);
950 assert(table->LoadMatrixf);
951 assert(table->LoadName);
952 assert(table->LogicOp);
953 assert(table->Map1d);
954 assert(table->Map1f);
955 assert(table->Map2d);
956 assert(table->Map2f);
957 assert(table->MapGrid1d);
958 assert(table->MapGrid1f);
959 assert(table->MapGrid2d);
960 assert(table->MapGrid2f);
961 assert(table->Materialf);
962 assert(table->Materialfv);
963 assert(table->Materiali);
964 assert(table->Materialiv);
965 assert(table->MatrixMode);
966 assert(table->MultMatrixd);
967 assert(table->MultMatrixf);
968 assert(table->NewList);
969 assert(table->Normal3b);
970 assert(table->Normal3bv);
971 assert(table->Normal3d);
972 assert(table->Normal3dv);
973 assert(table->Normal3f);
974 assert(table->Normal3fv);
975 assert(table->Normal3i);
976 assert(table->Normal3iv);
977 assert(table->Normal3s);
978 assert(table->Normal3sv);
979 assert(table->Ortho);
980 assert(table->PassThrough);
981 assert(table->PixelMapfv);
982 assert(table->PixelMapuiv);
983 assert(table->PixelMapusv);
984 assert(table->PixelStoref);
985 assert(table->PixelStorei);
986 assert(table->PixelTransferf);
987 assert(table->PixelTransferi);
988 assert(table->PixelZoom);
989 assert(table->PointSize);
990 assert(table->PolygonMode);
991 assert(table->PolygonOffset);
992 assert(table->PolygonStipple);
993 assert(table->PopAttrib);
994 assert(table->PopMatrix);
995 assert(table->PopName);
996 assert(table->PushAttrib);
997 assert(table->PushMatrix);
998 assert(table->PushName);
999 assert(table->RasterPos2d);
1000 assert(table->RasterPos2dv);
1001 assert(table->RasterPos2f);
1002 assert(table->RasterPos2fv);
1003 assert(table->RasterPos2i);
1004 assert(table->RasterPos2iv);
1005 assert(table->RasterPos2s);
1006 assert(table->RasterPos2sv);
1007 assert(table->RasterPos3d);
1008 assert(table->RasterPos3dv);
1009 assert(table->RasterPos3f);
1010 assert(table->RasterPos3fv);
1011 assert(table->RasterPos3i);
1012 assert(table->RasterPos3iv);
1013 assert(table->RasterPos3s);
1014 assert(table->RasterPos3sv);
1015 assert(table->RasterPos4d);
1016 assert(table->RasterPos4dv);
1017 assert(table->RasterPos4f);
1018 assert(table->RasterPos4fv);
1019 assert(table->RasterPos4i);
1020 assert(table->RasterPos4iv);
1021 assert(table->RasterPos4s);
1022 assert(table->RasterPos4sv);
1023 assert(table->ReadBuffer);
1024 assert(table->ReadPixels);
1025 assert(table->Rectd);
1026 assert(table->Rectdv);
1027 assert(table->Rectf);
1028 assert(table->Rectfv);
1029 assert(table->Recti);
1030 assert(table->Rectiv);
1031 assert(table->Rects);
1032 assert(table->Rectsv);
1033 assert(table->RenderMode);
1034 assert(table->Rotated);
1035 assert(table->Rotatef);
1036 assert(table->Scaled);
1037 assert(table->Scalef);
1038 assert(table->Scissor);
1039 assert(table->SelectBuffer);
1040 assert(table->ShadeModel);
1041 assert(table->StencilFunc);
1042 assert(table->StencilMask);
1043 assert(table->StencilOp);
1044 assert(table->TexCoord1d);
1045 assert(table->TexCoord1dv);
1046 assert(table->TexCoord1f);
1047 assert(table->TexCoord1fv);
1048 assert(table->TexCoord1i);
1049 assert(table->TexCoord1iv);
1050 assert(table->TexCoord1s);
1051 assert(table->TexCoord1sv);
1052 assert(table->TexCoord2d);
1053 assert(table->TexCoord2dv);
1054 assert(table->TexCoord2f);
1055 assert(table->TexCoord2fv);
1056 assert(table->TexCoord2i);
1057 assert(table->TexCoord2iv);
1058 assert(table->TexCoord2s);
1059 assert(table->TexCoord2sv);
1060 assert(table->TexCoord3d);
1061 assert(table->TexCoord3dv);
1062 assert(table->TexCoord3f);
1063 assert(table->TexCoord3fv);
1064 assert(table->TexCoord3i);
1065 assert(table->TexCoord3iv);
1066 assert(table->TexCoord3s);
1067 assert(table->TexCoord3sv);
1068 assert(table->TexCoord4d);
1069 assert(table->TexCoord4dv);
1070 assert(table->TexCoord4f);
1071 assert(table->TexCoord4fv);
1072 assert(table->TexCoord4i);
1073 assert(table->TexCoord4iv);
1074 assert(table->TexCoord4s);
1075 assert(table->TexCoord4sv);
1076 assert(table->TexEnvf);
1077 assert(table->TexEnvfv);
1078 assert(table->TexEnvi);
1079 assert(table->TexEnviv);
1080 assert(table->TexGend);
1081 assert(table->TexGendv);
1082 assert(table->TexGenf);
1083 assert(table->TexGenfv);
1084 assert(table->TexGeni);
1085 assert(table->TexGeniv);
1086 assert(table->TexImage1D);
1087 assert(table->TexImage2D);
1088 assert(table->TexParameterf);
1089 assert(table->TexParameterfv);
1090 assert(table->TexParameteri);
1091 assert(table->TexParameteriv);
1092 assert(table->Translated);
1093 assert(table->Translatef);
1094 assert(table->Vertex2d);
1095 assert(table->Vertex2dv);
1096 assert(table->Vertex2f);
1097 assert(table->Vertex2fv);
1098 assert(table->Vertex2i);
1099 assert(table->Vertex2iv);
1100 assert(table->Vertex2s);
1101 assert(table->Vertex2sv);
1102 assert(table->Vertex3d);
1103 assert(table->Vertex3dv);
1104 assert(table->Vertex3f);
1105 assert(table->Vertex3fv);
1106 assert(table->Vertex3i);
1107 assert(table->Vertex3iv);
1108 assert(table->Vertex3s);
1109 assert(table->Vertex3sv);
1110 assert(table->Vertex4d);
1111 assert(table->Vertex4dv);
1112 assert(table->Vertex4f);
1113 assert(table->Vertex4fv);
1114 assert(table->Vertex4i);
1115 assert(table->Vertex4iv);
1116 assert(table->Vertex4s);
1117 assert(table->Vertex4sv);
1118 assert(table->Viewport);
1119
1120 #ifdef _GLAPI_VERSION_1_1
1121 assert(table->AreTexturesResident);
1122 assert(table->ArrayElement);
1123 assert(table->BindTexture);
1124 assert(table->ColorPointer);
1125 assert(table->CopyTexImage1D);
1126 assert(table->CopyTexImage2D);
1127 assert(table->CopyTexSubImage1D);
1128 assert(table->CopyTexSubImage2D);
1129 assert(table->DeleteTextures);
1130 assert(table->DisableClientState);
1131 assert(table->DrawArrays);
1132 assert(table->EdgeFlagPointer);
1133 assert(table->EnableClientState);
1134 assert(table->GenTextures);
1135 assert(table->GetPointerv);
1136 assert(table->IndexPointer);
1137 assert(table->Indexub);
1138 assert(table->Indexubv);
1139 assert(table->InterleavedArrays);
1140 assert(table->IsTexture);
1141 assert(table->NormalPointer);
1142 assert(table->PopClientAttrib);
1143 assert(table->PrioritizeTextures);
1144 assert(table->PushClientAttrib);
1145 assert(table->TexCoordPointer);
1146 assert(table->TexSubImage1D);
1147 assert(table->TexSubImage2D);
1148 assert(table->VertexPointer);
1149 #endif
1150
1151 #ifdef _GLAPI_VERSION_1_2
1152 assert(table->CopyTexSubImage3D);
1153 assert(table->DrawRangeElements);
1154 assert(table->TexImage3D);
1155 assert(table->TexSubImage3D);
1156 #ifdef _GLAPI_ARB_imaging
1157 assert(table->BlendColor);
1158 assert(table->BlendEquation);
1159 assert(table->ColorSubTable);
1160 assert(table->ColorTable);
1161 assert(table->ColorTableParameterfv);
1162 assert(table->ColorTableParameteriv);
1163 assert(table->ConvolutionFilter1D);
1164 assert(table->ConvolutionFilter2D);
1165 assert(table->ConvolutionParameterf);
1166 assert(table->ConvolutionParameterfv);
1167 assert(table->ConvolutionParameteri);
1168 assert(table->ConvolutionParameteriv);
1169 assert(table->CopyColorSubTable);
1170 assert(table->CopyColorTable);
1171 assert(table->CopyConvolutionFilter1D);
1172 assert(table->CopyConvolutionFilter2D);
1173 assert(table->GetColorTable);
1174 assert(table->GetColorTableParameterfv);
1175 assert(table->GetColorTableParameteriv);
1176 assert(table->GetConvolutionFilter);
1177 assert(table->GetConvolutionParameterfv);
1178 assert(table->GetConvolutionParameteriv);
1179 assert(table->GetHistogram);
1180 assert(table->GetHistogramParameterfv);
1181 assert(table->GetHistogramParameteriv);
1182 assert(table->GetMinmax);
1183 assert(table->GetMinmaxParameterfv);
1184 assert(table->GetMinmaxParameteriv);
1185 assert(table->Histogram);
1186 assert(table->Minmax);
1187 assert(table->ResetHistogram);
1188 assert(table->ResetMinmax);
1189 assert(table->SeparableFilter2D);
1190 #endif
1191 #endif
1192
1193
1194 #ifdef _GLAPI_EXT_paletted_texture
1195 assert(table->ColorTableEXT);
1196 assert(table->ColorSubTableEXT);
1197 assert(table->GetColorTableEXT);
1198 assert(table->GetColorTableParameterfvEXT);
1199 assert(table->GetColorTableParameterivEXT);
1200 #endif
1201
1202 #ifdef _GLAPI_EXT_compiled_vertex_array
1203 assert(table->LockArraysEXT);
1204 assert(table->UnlockArraysEXT);
1205 #endif
1206
1207 #ifdef _GLAPI_EXT_point_parameter
1208 assert(table->PointParameterfEXT);
1209 assert(table->PointParameterfvEXT);
1210 #endif
1211
1212 #ifdef _GLAPI_EXT_polygon_offset
1213 assert(table->PolygonOffsetEXT);
1214 #endif
1215
1216 #ifdef _GLAPI_ARB_multitexture
1217 assert(table->ActiveTextureARB);
1218 assert(table->ClientActiveTextureARB);
1219 assert(table->MultiTexCoord1dARB);
1220 assert(table->MultiTexCoord1dvARB);
1221 assert(table->MultiTexCoord1fARB);
1222 assert(table->MultiTexCoord1fvARB);
1223 assert(table->MultiTexCoord1iARB);
1224 assert(table->MultiTexCoord1ivARB);
1225 assert(table->MultiTexCoord1sARB);
1226 assert(table->MultiTexCoord1svARB);
1227 assert(table->MultiTexCoord2dARB);
1228 assert(table->MultiTexCoord2dvARB);
1229 assert(table->MultiTexCoord2fARB);
1230 assert(table->MultiTexCoord2fvARB);
1231 assert(table->MultiTexCoord2iARB);
1232 assert(table->MultiTexCoord2ivARB);
1233 assert(table->MultiTexCoord2sARB);
1234 assert(table->MultiTexCoord2svARB);
1235 assert(table->MultiTexCoord3dARB);
1236 assert(table->MultiTexCoord3dvARB);
1237 assert(table->MultiTexCoord3fARB);
1238 assert(table->MultiTexCoord3fvARB);
1239 assert(table->MultiTexCoord3iARB);
1240 assert(table->MultiTexCoord3ivARB);
1241 assert(table->MultiTexCoord3sARB);
1242 assert(table->MultiTexCoord3svARB);
1243 assert(table->MultiTexCoord4dARB);
1244 assert(table->MultiTexCoord4dvARB);
1245 assert(table->MultiTexCoord4fARB);
1246 assert(table->MultiTexCoord4fvARB);
1247 assert(table->MultiTexCoord4iARB);
1248 assert(table->MultiTexCoord4ivARB);
1249 assert(table->MultiTexCoord4sARB);
1250 assert(table->MultiTexCoord4svARB);
1251 #endif
1252
1253 #ifdef _GLAPI_INGR_blend_func_separate
1254 assert(table->BlendFuncSeparateINGR);
1255 #endif
1256
1257 #ifdef _GLAPI_MESA_window_pos
1258 assert(table->WindowPos4fMESA);
1259 #endif
1260
1261 #ifdef _GLAPI_MESA_resize_buffers
1262 assert(table->ResizeBuffersMESA);
1263 #endif
1264 }
1265
1266
1267
1268 /*
1269 * Generate the GL entrypoint functions here.
1270 */
1271
1272 #define KEYWORD1
1273 #define KEYWORD2 GLAPIENTRY
1274 #ifdef USE_MGL_NAMESPACE
1275 #define NAME(func) mgl##func
1276 #else
1277 #define NAME(func) gl##func
1278 #endif
1279
1280 #include "glapitemp.h"
1281