f9c754c7c12c4b910ab9b8c338668583b8247c61
[mesa.git] / src / mesa / glapi / glapi.c
1 /* $Id: glapi.c,v 1.24 2000/01/16 07:26:35 joshv Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 *
7 * Copyright (C) 1999-2000 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 #include "glapioffsets.h"
45 #include "glapitable.h"
46
47
48
49 /* This is used when thread safety is disabled */
50 struct _glapi_table *_mesa_Dispatch = &__glapi_noop_table;
51
52 /* Used when thread safety disabled */
53 void *_glapi_CurrentContext = NULL;
54
55
56 #if defined(THREADS)
57
58 #include "glthread.h"
59
60 /* Flag to indicate whether thread-safe dispatch is enabled */
61 static GLboolean ThreadSafe = GL_FALSE;
62
63 static _glthread_TSD DispatchTSD;
64
65 static void dispatch_thread_init()
66 {
67 _glthread_InitTSD(&DispatchTSD);
68 }
69
70
71 static _glthread_TSD ContextTSD;
72
73 static void context_thread_init()
74 {
75 _glthread_InitTSD(&ContextTSD);
76 }
77
78 #endif
79
80
81
82 static GLuint MaxDispatchOffset = sizeof(struct _glapi_table) / sizeof(void *) - 1;
83 static GLboolean GetSizeCalled = GL_FALSE;
84
85
86
87 /*
88 * We should call this periodically from a function such as glXMakeCurrent
89 * in order to test if multiple threads are being used. When we detect
90 * that situation we should then call _glapi_enable_thread_safety()
91 */
92 void
93 _glapi_check_multithread(void)
94 {
95 #if defined(THREADS)
96 if (!ThreadSafe) {
97 static unsigned long knownID;
98 static GLboolean firstCall = GL_TRUE;
99 if (firstCall) {
100 knownID = _glthread_GetID();
101 firstCall = GL_FALSE;
102 }
103 else if (knownID != _glthread_GetID()) {
104 ThreadSafe = GL_TRUE;
105 }
106 }
107 if (ThreadSafe) {
108 /* make sure that this thread's dispatch pointer isn't null */
109 if (!_glapi_get_dispatch()) {
110 _glapi_set_dispatch(NULL);
111 }
112 }
113 #endif
114 }
115
116
117
118 /*
119 * Set the current context pointer for this thread.
120 * The context pointer is an opaque type which should be cast to
121 * void from the real context pointer type.
122 */
123 void
124 _glapi_set_current_context(void *context)
125 {
126 #if defined(THREADS)
127 _glthread_SetTSD(&ContextTSD, context, context_thread_init);
128 if (ThreadSafe)
129 _glapi_CurrentContext = NULL; /* to help with debugging */
130 else
131 _glapi_CurrentContext = context;
132 #else
133 _glapi_CurrentContext = context;
134 #endif
135 }
136
137
138
139 /*
140 * Get the current context pointer for this thread.
141 * The context pointer is an opaque type which should be cast from
142 * void to the real context pointer type.
143 */
144 void *
145 _glapi_get_current_context(void)
146 {
147 #if defined(THREADS)
148 if (ThreadSafe) {
149 return _glthread_GetTSD(&ContextTSD);
150 }
151 else {
152 return _glapi_CurrentContext;
153 }
154 #else
155 return _glapi_CurrentContext;
156 #endif
157 }
158
159
160
161 /*
162 * Set the global or per-thread dispatch table pointer.
163 */
164 void
165 _glapi_set_dispatch(struct _glapi_table *dispatch)
166 {
167 if (!dispatch) {
168 /* use the no-op functions */
169 dispatch = &__glapi_noop_table;
170 }
171 #ifdef DEBUG
172 else {
173 _glapi_check_table(dispatch);
174 }
175 #endif
176
177 #if defined(THREADS)
178 _glthread_SetTSD(&DispatchTSD, (void*) dispatch, dispatch_thread_init);
179 if (ThreadSafe)
180 _mesa_Dispatch = NULL; /* to help with debugging */
181 else
182 _mesa_Dispatch = dispatch;
183 #else
184 _mesa_Dispatch = dispatch;
185 #endif
186 }
187
188
189
190 /*
191 * Return pointer to current dispatch table for calling thread.
192 */
193 struct _glapi_table *
194 _glapi_get_dispatch(void)
195 {
196 #if defined(THREADS)
197 if (ThreadSafe) {
198 return (struct _glapi_table *) _glthread_GetTSD(&DispatchTSD);
199 }
200 else {
201 assert(_mesa_Dispatch);
202 return _mesa_Dispatch;
203 }
204 #else
205 return _mesa_Dispatch;
206 #endif
207 }
208
209
210
211 /*
212 * Return size of dispatch table struct as number of functions (or
213 * slots).
214 */
215 GLuint
216 _glapi_get_dispatch_table_size(void)
217 {
218 /* return sizeof(struct _glapi_table) / sizeof(void *);*/
219 GetSizeCalled = GL_TRUE;
220 return MaxDispatchOffset + 1;
221 }
222
223
224
225 /*
226 * Get API dispatcher version string.
227 * XXX this isn't well defined yet.
228 */
229 const char *
230 _glapi_get_version(void)
231 {
232 return "1.2";
233 }
234
235
236 struct name_address_pair {
237 const char *Name;
238 GLvoid *Address;
239 };
240
241 static struct name_address_pair static_functions[1000];
242
243
244
245 /*
246 * Return dispatch table offset of the named static (built-in) function.
247 * Return -1 if function not found.
248 */
249 static GLint
250 get_static_proc_offset(const char *funcName)
251 {
252 GLuint i;
253 for (i = 0; static_functions[i].Name; i++) {
254 if (strcmp(static_functions[i].Name, funcName) == 0) {
255 return i;
256 }
257 }
258 return -1;
259 }
260
261
262 /*
263 * Return dispatch function address the named static (built-in) function.
264 * Return NULL if function not found.
265 */
266 static GLvoid *
267 get_static_proc_address(const char *funcName)
268 {
269 GLuint i = get_static_proc_offset(funcName);
270 if (i >= 0)
271 return static_functions[i].Address;
272 else
273 return NULL;
274 }
275
276
277
278 /**********************************************************************
279 * Extension function management.
280 */
281
282
283 struct _glapi_ext_entrypoint {
284 const char *Name; /* the extension function's name */
285 GLuint Offset; /* relative to start of dispatch table */
286 GLvoid *Address; /* address of dispatch function */
287 };
288
289 static struct _glapi_ext_entrypoint ExtEntryTable[_GLAPI_EXTRA_SLOTS];
290 static GLuint NumExtEntryPoints = 0;
291
292
293
294 /*
295 * Generate a dispatch function (entrypoint) which jumps through
296 * the given slot number (offset) in the current dispatch table.
297 */
298 static void *
299 generate_entrypoint(GLuint offset)
300 {
301 /* XXX need to generate some assembly code here */
302
303 return NULL;
304 }
305
306
307
308 /*
309 * Add a new extension function entrypoint.
310 * Return: GL_TRUE = success or GL_FALSE = failure
311 */
312 GLboolean
313 _glapi_add_entrypoint(const char *funcName, GLuint offset)
314 {
315 GLint index;
316
317 /* Make sure we don't try to add a new entrypoint after someone
318 * has already called _glapi_get_dispatch_table_size()! If that's
319 * happened the caller's information will now be out of date.
320 */
321 assert(!GetSizeCalled);
322
323 /* first check if the named function is already statically present */
324 index = get_static_proc_offset(funcName);
325
326 if (index >= 0) {
327 assert(index == offset);
328 return GL_TRUE;
329 }
330 /* else if (offset < _glapi_get_dispatch_table_size()) { */
331 else {
332 /* be sure index and name match known data */
333 GLuint i;
334 for (i = 0; i < NumExtEntryPoints; i++) {
335 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
336 /* function already registered with api */
337 if (ExtEntryTable[i].Offset == offset) {
338 return GL_TRUE; /* offsets match */
339 }
340 else {
341 return GL_FALSE; /* bad offset! */
342 }
343 }
344 }
345 assert(NumExtEntryPoints < _GLAPI_EXTRA_SLOTS);
346 ExtEntryTable[NumExtEntryPoints].Name = strdup(funcName);
347 ExtEntryTable[NumExtEntryPoints].Offset = offset;
348 ExtEntryTable[NumExtEntryPoints].Address = generate_entrypoint(offset);
349 NumExtEntryPoints++;
350
351 if (offset > MaxDispatchOffset)
352 MaxDispatchOffset = offset;
353
354 return GL_TRUE;
355 }
356 /*
357 else {
358 return GL_FALSE;
359 }
360 */
361 }
362
363
364
365 /*
366 * Return offset of entrypoint for named function within dispatch table.
367 */
368 GLint
369 _glapi_get_proc_offset(const char *funcName)
370 {
371 /* search extension functions first */
372 GLint i;
373 for (i = 0; i < NumExtEntryPoints; i++) {
374 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
375 return ExtEntryTable[i].Offset;
376 }
377 }
378
379 /* search static functions */
380 return get_static_proc_offset(funcName);
381 }
382
383
384
385 /*
386 * Return entrypoint for named function.
387 */
388 const GLvoid *
389 _glapi_get_proc_address(const char *funcName)
390 {
391 /* search extension functions first */
392 GLint i;
393 for (i = 0; i < NumExtEntryPoints; i++) {
394 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
395 return ExtEntryTable[i].Address;
396 }
397 }
398
399 /* search static functions */
400 return get_static_proc_address(funcName);
401 }
402
403
404
405
406 /*
407 * Return the name of the function at the given dispatch offset.
408 * This is only intended for debugging.
409 */
410 const char *
411 _glapi_get_proc_name(GLuint offset)
412 {
413 GLuint n = sizeof(static_functions) / sizeof(struct name_address_pair);
414 if (offset < n) {
415 return static_functions[offset].Name;
416 }
417 else {
418 /* search added extension functions */
419 GLuint i;
420 for (i = 0; i < NumExtEntryPoints; i++) {
421 if (ExtEntryTable[i].Offset == offset) {
422 return ExtEntryTable[i].Name;
423 }
424 }
425 return NULL;
426 }
427 }
428
429
430
431 /*
432 * Make sure there are no NULL pointers in the given dispatch table.
433 * Intented for debugging purposes.
434 */
435 void
436 _glapi_check_table(const struct _glapi_table *table)
437 {
438 const GLuint entries = _glapi_get_dispatch_table_size();
439 const void **tab = (const void **) table;
440 GLuint i;
441 for (i = 1; i < entries; i++) {
442 assert(tab[i]);
443 }
444
445 #ifdef DEBUG
446 /* Do some spot checks to be sure that the dispatch table
447 * slots are assigned correctly.
448 */
449 {
450 GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
451 char *BeginFunc = (char*) &table->Begin;
452 GLuint offset = (BeginFunc - (char *) table) / sizeof(void *);
453 assert(BeginOffset == _gloffset_Begin);
454 assert(BeginOffset == offset);
455 }
456 {
457 GLuint viewportOffset = _glapi_get_proc_offset("glViewport");
458 char *viewportFunc = (char*) &table->Viewport;
459 GLuint offset = (viewportFunc - (char *) table) / sizeof(void *);
460 assert(viewportOffset == _gloffset_Viewport);
461 assert(viewportOffset == offset);
462 }
463 {
464 GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer");
465 char *VertexPointerFunc = (char*) &table->VertexPointer;
466 GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *);
467 assert(VertexPointerOffset == _gloffset_VertexPointer);
468 assert(VertexPointerOffset == offset);
469 }
470 {
471 GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax");
472 char *ResetMinMaxFunc = (char*) &table->ResetMinmax;
473 GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *);
474 assert(ResetMinMaxOffset == _gloffset_ResetMinmax);
475 assert(ResetMinMaxOffset == offset);
476 }
477 {
478 GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColorEXT");
479 char *blendColorFunc = (char*) &table->BlendColorEXT;
480 GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *);
481 assert(blendColorOffset == _gloffset_BlendColorEXT);
482 assert(blendColorOffset == offset);
483 }
484 {
485 GLuint istextureOffset = _glapi_get_proc_offset("glIsTextureEXT");
486 char *istextureFunc = (char*) &table->IsTextureEXT;
487 GLuint offset = (istextureFunc - (char *) table) / sizeof(void *);
488 assert(istextureOffset == _gloffset_IsTextureEXT);
489 assert(istextureOffset == offset);
490 }
491 #endif
492 }
493
494
495 /**********************************************************************
496 * Generate the GL entrypoint functions here.
497 */
498
499 #define KEYWORD1
500 #define KEYWORD2 GLAPIENTRY
501 #ifdef USE_MGL_NAMESPACE
502 #define NAME(func) mgl##func
503 #else
504 #define NAME(func) gl##func
505 #endif
506
507 #ifdef DEBUG
508
509 #include <stdio.h>
510
511 static int
512 trace(void)
513 {
514 static int trace = -1;
515 if (trace < 0)
516 trace = getenv("MESA_TRACE") ? 1 : 0;
517 return trace > 0;
518 }
519
520 #define DISPATCH(FUNC, ARGS, MESSAGE) \
521 const struct _glapi_table *dispatch; \
522 dispatch = _mesa_Dispatch ? _mesa_Dispatch : _glapi_get_dispatch(); \
523 if (trace()) printf MESSAGE; \
524 (dispatch->FUNC) ARGS
525
526 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
527 const struct _glapi_table *dispatch; \
528 dispatch = _mesa_Dispatch ? _mesa_Dispatch : _glapi_get_dispatch(); \
529 if (trace()) printf MESSAGE; \
530 return (dispatch->FUNC) ARGS
531
532 #else
533
534 #define DISPATCH(FUNC, ARGS, MESSAGE) \
535 const struct _glapi_table *dispatch; \
536 dispatch = _mesa_Dispatch ? _mesa_Dispatch : _glapi_get_dispatch(); \
537 (dispatch->FUNC) ARGS
538
539 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
540 const struct _glapi_table *dispatch; \
541 dispatch = _mesa_Dispatch ? _mesa_Dispatch : _glapi_get_dispatch(); \
542 return (dispatch->FUNC) ARGS
543
544 #endif
545
546
547 #ifndef GLAPIENTRY
548 #define GLAPIENTRY
549 #endif
550
551 #if defined(USE_X86_ASM) && !defined(__WIN32__)
552 #undef NAME
553 #define NAME(func) _mesa_fallback_##func
554 #endif
555
556 #include "glapitemp.h"
557
558
559 /*
560 * For each entry in static_functions[] which use this function
561 * we should implement a dispatch function in glapitemp.h and
562 * in glapinoop.c
563 */
564 static int NotImplemented(void)
565 {
566 return 0;
567 }
568
569
570
571 static struct name_address_pair static_functions[] = {
572 { "NotImplemented", (GLvoid *) NotImplemented },
573
574 /* GL 1.1 */
575 { "glAccum", (GLvoid *) glAccum },
576 { "glAlphaFunc", (GLvoid *) glAlphaFunc },
577 { "glBegin", (GLvoid *) glBegin },
578 { "glBitmap", (GLvoid *) glBitmap },
579 { "glBlendFunc", (GLvoid *) glBlendFunc },
580 { "glCallList", (GLvoid *) glCallList },
581 { "glCallLists", (GLvoid *) glCallLists },
582 { "glClear", (GLvoid *) glClear },
583 { "glClearAccum", (GLvoid *) glClearAccum },
584 { "glClearColor", (GLvoid *) glClearColor },
585 { "glClearDepth", (GLvoid *) glClearDepth },
586 { "glClearIndex", (GLvoid *) glClearIndex },
587 { "glClearStencil", (GLvoid *) glClearStencil },
588 { "glClipPlane", (GLvoid *) glClipPlane },
589 { "glColor3b", (GLvoid *) glColor3b },
590 { "glColor3bv", (GLvoid *) glColor3bv },
591 { "glColor3d", (GLvoid *) glColor3d },
592 { "glColor3dv", (GLvoid *) glColor3dv },
593 { "glColor3f", (GLvoid *) glColor3f },
594 { "glColor3fv", (GLvoid *) glColor3fv },
595 { "glColor3i", (GLvoid *) glColor3i },
596 { "glColor3iv", (GLvoid *) glColor3iv },
597 { "glColor3s", (GLvoid *) glColor3s },
598 { "glColor3sv", (GLvoid *) glColor3sv },
599 { "glColor3ub", (GLvoid *) glColor3ub },
600 { "glColor3ubv", (GLvoid *) glColor3ubv },
601 { "glColor3ui", (GLvoid *) glColor3ui },
602 { "glColor3uiv", (GLvoid *) glColor3uiv },
603 { "glColor3us", (GLvoid *) glColor3us },
604 { "glColor3usv", (GLvoid *) glColor3usv },
605 { "glColor4b", (GLvoid *) glColor4b },
606 { "glColor4bv", (GLvoid *) glColor4bv },
607 { "glColor4d", (GLvoid *) glColor4d },
608 { "glColor4dv", (GLvoid *) glColor4dv },
609 { "glColor4f", (GLvoid *) glColor4f },
610 { "glColor4fv", (GLvoid *) glColor4fv },
611 { "glColor4i", (GLvoid *) glColor4i },
612 { "glColor4iv", (GLvoid *) glColor4iv },
613 { "glColor4s", (GLvoid *) glColor4s },
614 { "glColor4sv", (GLvoid *) glColor4sv },
615 { "glColor4ub", (GLvoid *) glColor4ub },
616 { "glColor4ubv", (GLvoid *) glColor4ubv },
617 { "glColor4ui", (GLvoid *) glColor4ui },
618 { "glColor4uiv", (GLvoid *) glColor4uiv },
619 { "glColor4us", (GLvoid *) glColor4us },
620 { "glColor4usv", (GLvoid *) glColor4usv },
621 { "glColorMask", (GLvoid *) glColorMask },
622 { "glColorMaterial", (GLvoid *) glColorMaterial },
623 { "glCopyPixels", (GLvoid *) glCopyPixels },
624 { "glCullFace", (GLvoid *) glCullFace },
625 { "glDeleteLists", (GLvoid *) glDeleteLists },
626 { "glDepthFunc", (GLvoid *) glDepthFunc },
627 { "glDepthMask", (GLvoid *) glDepthMask },
628 { "glDepthRange", (GLvoid *) glDepthRange },
629 { "glDisable", (GLvoid *) glDisable },
630 { "glDrawBuffer", (GLvoid *) glDrawBuffer },
631 { "glDrawPixels", (GLvoid *) glDrawPixels },
632 { "glEdgeFlag", (GLvoid *) glEdgeFlag },
633 { "glEdgeFlagv", (GLvoid *) glEdgeFlagv },
634 { "glEnable", (GLvoid *) glEnable },
635 { "glEnd", (GLvoid *) glEnd },
636 { "glEndList", (GLvoid *) glEndList },
637 { "glEvalCoord1d", (GLvoid *) glEvalCoord1d },
638 { "glEvalCoord1dv", (GLvoid *) glEvalCoord1dv },
639 { "glEvalCoord1f", (GLvoid *) glEvalCoord1f },
640 { "glEvalCoord1fv", (GLvoid *) glEvalCoord1fv },
641 { "glEvalCoord2d", (GLvoid *) glEvalCoord2d },
642 { "glEvalCoord2dv", (GLvoid *) glEvalCoord2dv },
643 { "glEvalCoord2f", (GLvoid *) glEvalCoord2f },
644 { "glEvalCoord2fv", (GLvoid *) glEvalCoord2fv },
645 { "glEvalMesh1", (GLvoid *) glEvalMesh1 },
646 { "glEvalMesh2", (GLvoid *) glEvalMesh2 },
647 { "glEvalPoint1", (GLvoid *) glEvalPoint1 },
648 { "glEvalPoint2", (GLvoid *) glEvalPoint2 },
649 { "glFeedbackBuffer", (GLvoid *) glFeedbackBuffer },
650 { "glFinish", (GLvoid *) glFinish },
651 { "glFlush", (GLvoid *) glFlush },
652 { "glFogf", (GLvoid *) glFogf },
653 { "glFogfv", (GLvoid *) glFogfv },
654 { "glFogi", (GLvoid *) glFogi },
655 { "glFogiv", (GLvoid *) glFogiv },
656 { "glFrontFace", (GLvoid *) glFrontFace },
657 { "glFrustum", (GLvoid *) glFrustum },
658 { "glGenLists", (GLvoid *) glGenLists },
659 { "glGetBooleanv", (GLvoid *) glGetBooleanv },
660 { "glGetClipPlane", (GLvoid *) glGetClipPlane },
661 { "glGetDoublev", (GLvoid *) glGetDoublev },
662 { "glGetError", (GLvoid *) glGetError },
663 { "glGetFloatv", (GLvoid *) glGetFloatv },
664 { "glGetIntegerv", (GLvoid *) glGetIntegerv },
665 { "glGetLightfv", (GLvoid *) glGetLightfv },
666 { "glGetLightiv", (GLvoid *) glGetLightiv },
667 { "glGetMapdv", (GLvoid *) glGetMapdv },
668 { "glGetMapfv", (GLvoid *) glGetMapfv },
669 { "glGetMapiv", (GLvoid *) glGetMapiv },
670 { "glGetMaterialfv", (GLvoid *) glGetMaterialfv },
671 { "glGetMaterialiv", (GLvoid *) glGetMaterialiv },
672 { "glGetPixelMapfv", (GLvoid *) glGetPixelMapfv },
673 { "glGetPixelMapuiv", (GLvoid *) glGetPixelMapuiv },
674 { "glGetPixelMapusv", (GLvoid *) glGetPixelMapusv },
675 { "glGetPolygonStipple", (GLvoid *) glGetPolygonStipple },
676 { "glGetString", (GLvoid *) glGetString },
677 { "glGetTexEnvfv", (GLvoid *) glGetTexEnvfv },
678 { "glGetTexEnviv", (GLvoid *) glGetTexEnviv },
679 { "glGetTexGendv", (GLvoid *) glGetTexGendv },
680 { "glGetTexGenfv", (GLvoid *) glGetTexGenfv },
681 { "glGetTexGeniv", (GLvoid *) glGetTexGeniv },
682 { "glGetTexImage", (GLvoid *) glGetTexImage },
683 { "glGetTexLevelParameterfv", (GLvoid *) glGetTexLevelParameterfv },
684 { "glGetTexLevelParameteriv", (GLvoid *) glGetTexLevelParameteriv },
685 { "glGetTexParameterfv", (GLvoid *) glGetTexParameterfv },
686 { "glGetTexParameteriv", (GLvoid *) glGetTexParameteriv },
687 { "glHint", (GLvoid *) glHint },
688 { "glIndexMask", (GLvoid *) glIndexMask },
689 { "glIndexd", (GLvoid *) glIndexd },
690 { "glIndexdv", (GLvoid *) glIndexdv },
691 { "glIndexf", (GLvoid *) glIndexf },
692 { "glIndexfv", (GLvoid *) glIndexfv },
693 { "glIndexi", (GLvoid *) glIndexi },
694 { "glIndexiv", (GLvoid *) glIndexiv },
695 { "glIndexs", (GLvoid *) glIndexs },
696 { "glIndexsv", (GLvoid *) glIndexsv },
697 { "glInitNames", (GLvoid *) glInitNames },
698 { "glIsEnabled", (GLvoid *) glIsEnabled },
699 { "glIsList", (GLvoid *) glIsList },
700 { "glLightModelf", (GLvoid *) glLightModelf },
701 { "glLightModelfv", (GLvoid *) glLightModelfv },
702 { "glLightModeli", (GLvoid *) glLightModeli },
703 { "glLightModeliv", (GLvoid *) glLightModeliv },
704 { "glLightf", (GLvoid *) glLightf },
705 { "glLightfv", (GLvoid *) glLightfv },
706 { "glLighti", (GLvoid *) glLighti },
707 { "glLightiv", (GLvoid *) glLightiv },
708 { "glLineStipple", (GLvoid *) glLineStipple },
709 { "glLineWidth", (GLvoid *) glLineWidth },
710 { "glListBase", (GLvoid *) glListBase },
711 { "glLoadIdentity", (GLvoid *) glLoadIdentity },
712 { "glLoadMatrixd", (GLvoid *) glLoadMatrixd },
713 { "glLoadMatrixf", (GLvoid *) glLoadMatrixf },
714 { "glLoadName", (GLvoid *) glLoadName },
715 { "glLogicOp", (GLvoid *) glLogicOp },
716 { "glMap1d", (GLvoid *) glMap1d },
717 { "glMap1f", (GLvoid *) glMap1f },
718 { "glMap2d", (GLvoid *) glMap2d },
719 { "glMap2f", (GLvoid *) glMap2f },
720 { "glMapGrid1d", (GLvoid *) glMapGrid1d },
721 { "glMapGrid1f", (GLvoid *) glMapGrid1f },
722 { "glMapGrid2d", (GLvoid *) glMapGrid2d },
723 { "glMapGrid2f", (GLvoid *) glMapGrid2f },
724 { "glMaterialf", (GLvoid *) glMaterialf },
725 { "glMaterialfv", (GLvoid *) glMaterialfv },
726 { "glMateriali", (GLvoid *) glMateriali },
727 { "glMaterialiv", (GLvoid *) glMaterialiv },
728 { "glMatrixMode", (GLvoid *) glMatrixMode },
729 { "glMultMatrixd", (GLvoid *) glMultMatrixd },
730 { "glMultMatrixf", (GLvoid *) glMultMatrixf },
731 { "glNewList", (GLvoid *) glNewList },
732 { "glNormal3b", (GLvoid *) glNormal3b },
733 { "glNormal3bv", (GLvoid *) glNormal3bv },
734 { "glNormal3d", (GLvoid *) glNormal3d },
735 { "glNormal3dv", (GLvoid *) glNormal3dv },
736 { "glNormal3f", (GLvoid *) glNormal3f },
737 { "glNormal3fv", (GLvoid *) glNormal3fv },
738 { "glNormal3i", (GLvoid *) glNormal3i },
739 { "glNormal3iv", (GLvoid *) glNormal3iv },
740 { "glNormal3s", (GLvoid *) glNormal3s },
741 { "glNormal3sv", (GLvoid *) glNormal3sv },
742 { "glOrtho", (GLvoid *) glOrtho },
743 { "glPassThrough", (GLvoid *) glPassThrough },
744 { "glPixelMapfv", (GLvoid *) glPixelMapfv },
745 { "glPixelMapuiv", (GLvoid *) glPixelMapuiv },
746 { "glPixelMapusv", (GLvoid *) glPixelMapusv },
747 { "glPixelStoref", (GLvoid *) glPixelStoref },
748 { "glPixelStorei", (GLvoid *) glPixelStorei },
749 { "glPixelTransferf", (GLvoid *) glPixelTransferf },
750 { "glPixelTransferi", (GLvoid *) glPixelTransferi },
751 { "glPixelZoom", (GLvoid *) glPixelZoom },
752 { "glPointSize", (GLvoid *) glPointSize },
753 { "glPolygonMode", (GLvoid *) glPolygonMode },
754 { "glPolygonOffset", (GLvoid *) glPolygonOffset },
755 { "glPolygonStipple", (GLvoid *) glPolygonStipple },
756 { "glPopAttrib", (GLvoid *) glPopAttrib },
757 { "glPopMatrix", (GLvoid *) glPopMatrix },
758 { "glPopName", (GLvoid *) glPopName },
759 { "glPushAttrib", (GLvoid *) glPushAttrib },
760 { "glPushMatrix", (GLvoid *) glPushMatrix },
761 { "glPushName", (GLvoid *) glPushName },
762 { "glRasterPos2d", (GLvoid *) glRasterPos2d },
763 { "glRasterPos2dv", (GLvoid *) glRasterPos2dv },
764 { "glRasterPos2f", (GLvoid *) glRasterPos2f },
765 { "glRasterPos2fv", (GLvoid *) glRasterPos2fv },
766 { "glRasterPos2i", (GLvoid *) glRasterPos2i },
767 { "glRasterPos2iv", (GLvoid *) glRasterPos2iv },
768 { "glRasterPos2s", (GLvoid *) glRasterPos2s },
769 { "glRasterPos2sv", (GLvoid *) glRasterPos2sv },
770 { "glRasterPos3d", (GLvoid *) glRasterPos3d },
771 { "glRasterPos3dv", (GLvoid *) glRasterPos3dv },
772 { "glRasterPos3f", (GLvoid *) glRasterPos3f },
773 { "glRasterPos3fv", (GLvoid *) glRasterPos3fv },
774 { "glRasterPos3i", (GLvoid *) glRasterPos3i },
775 { "glRasterPos3iv", (GLvoid *) glRasterPos3iv },
776 { "glRasterPos3s", (GLvoid *) glRasterPos3s },
777 { "glRasterPos3sv", (GLvoid *) glRasterPos3sv },
778 { "glRasterPos4d", (GLvoid *) glRasterPos4d },
779 { "glRasterPos4dv", (GLvoid *) glRasterPos4dv },
780 { "glRasterPos4f", (GLvoid *) glRasterPos4f },
781 { "glRasterPos4fv", (GLvoid *) glRasterPos4fv },
782 { "glRasterPos4i", (GLvoid *) glRasterPos4i },
783 { "glRasterPos4iv", (GLvoid *) glRasterPos4iv },
784 { "glRasterPos4s", (GLvoid *) glRasterPos4s },
785 { "glRasterPos4sv", (GLvoid *) glRasterPos4sv },
786 { "glReadBuffer", (GLvoid *) glReadBuffer },
787 { "glReadPixels", (GLvoid *) glReadPixels },
788 { "glRectd", (GLvoid *) glRectd },
789 { "glRectdv", (GLvoid *) glRectdv },
790 { "glRectf", (GLvoid *) glRectf },
791 { "glRectfv", (GLvoid *) glRectfv },
792 { "glRecti", (GLvoid *) glRecti },
793 { "glRectiv", (GLvoid *) glRectiv },
794 { "glRects", (GLvoid *) glRects },
795 { "glRectsv", (GLvoid *) glRectsv },
796 { "glRenderMode", (GLvoid *) glRenderMode },
797 { "glRotated", (GLvoid *) glRotated },
798 { "glRotatef", (GLvoid *) glRotatef },
799 { "glScaled", (GLvoid *) glScaled },
800 { "glScalef", (GLvoid *) glScalef },
801 { "glScissor", (GLvoid *) glScissor },
802 { "glSelectBuffer", (GLvoid *) glSelectBuffer },
803 { "glShadeModel", (GLvoid *) glShadeModel },
804 { "glStencilFunc", (GLvoid *) glStencilFunc },
805 { "glStencilMask", (GLvoid *) glStencilMask },
806 { "glStencilOp", (GLvoid *) glStencilOp },
807 { "glTexCoord1d", (GLvoid *) glTexCoord1d },
808 { "glTexCoord1dv", (GLvoid *) glTexCoord1dv },
809 { "glTexCoord1f", (GLvoid *) glTexCoord1f },
810 { "glTexCoord1fv", (GLvoid *) glTexCoord1fv },
811 { "glTexCoord1i", (GLvoid *) glTexCoord1i },
812 { "glTexCoord1iv", (GLvoid *) glTexCoord1iv },
813 { "glTexCoord1s", (GLvoid *) glTexCoord1s },
814 { "glTexCoord1sv", (GLvoid *) glTexCoord1sv },
815 { "glTexCoord2d", (GLvoid *) glTexCoord2d },
816 { "glTexCoord2dv", (GLvoid *) glTexCoord2dv },
817 { "glTexCoord2f", (GLvoid *) glTexCoord2f },
818 { "glTexCoord2fv", (GLvoid *) glTexCoord2fv },
819 { "glTexCoord2i", (GLvoid *) glTexCoord2i },
820 { "glTexCoord2iv", (GLvoid *) glTexCoord2iv },
821 { "glTexCoord2s", (GLvoid *) glTexCoord2s },
822 { "glTexCoord2sv", (GLvoid *) glTexCoord2sv },
823 { "glTexCoord3d", (GLvoid *) glTexCoord3d },
824 { "glTexCoord3dv", (GLvoid *) glTexCoord3dv },
825 { "glTexCoord3f", (GLvoid *) glTexCoord3f },
826 { "glTexCoord3fv", (GLvoid *) glTexCoord3fv },
827 { "glTexCoord3i", (GLvoid *) glTexCoord3i },
828 { "glTexCoord3iv", (GLvoid *) glTexCoord3iv },
829 { "glTexCoord3s", (GLvoid *) glTexCoord3s },
830 { "glTexCoord3sv", (GLvoid *) glTexCoord3sv },
831 { "glTexCoord4d", (GLvoid *) glTexCoord4d },
832 { "glTexCoord4dv", (GLvoid *) glTexCoord4dv },
833 { "glTexCoord4f", (GLvoid *) glTexCoord4f },
834 { "glTexCoord4fv", (GLvoid *) glTexCoord4fv },
835 { "glTexCoord4i", (GLvoid *) glTexCoord4i },
836 { "glTexCoord4iv", (GLvoid *) glTexCoord4iv },
837 { "glTexCoord4s", (GLvoid *) glTexCoord4s },
838 { "glTexCoord4sv", (GLvoid *) glTexCoord4sv },
839 { "glTexEnvf", (GLvoid *) glTexEnvf },
840 { "glTexEnvfv", (GLvoid *) glTexEnvfv },
841 { "glTexEnvi", (GLvoid *) glTexEnvi },
842 { "glTexEnviv", (GLvoid *) glTexEnviv },
843 { "glTexGend", (GLvoid *) glTexGend },
844 { "glTexGendv", (GLvoid *) glTexGendv },
845 { "glTexGenf", (GLvoid *) glTexGenf },
846 { "glTexGenfv", (GLvoid *) glTexGenfv },
847 { "glTexGeni", (GLvoid *) glTexGeni },
848 { "glTexGeniv", (GLvoid *) glTexGeniv },
849 { "glTexImage1D", (GLvoid *) glTexImage1D },
850 { "glTexImage2D", (GLvoid *) glTexImage2D },
851 { "glTexParameterf", (GLvoid *) glTexParameterf },
852 { "glTexParameterfv", (GLvoid *) glTexParameterfv },
853 { "glTexParameteri", (GLvoid *) glTexParameteri },
854 { "glTexParameteriv", (GLvoid *) glTexParameteriv },
855 { "glTranslated", (GLvoid *) glTranslated },
856 { "glTranslatef", (GLvoid *) glTranslatef },
857 { "glVertex2d", (GLvoid *) glVertex2d },
858 { "glVertex2dv", (GLvoid *) glVertex2dv },
859 { "glVertex2f", (GLvoid *) glVertex2f },
860 { "glVertex2fv", (GLvoid *) glVertex2fv },
861 { "glVertex2i", (GLvoid *) glVertex2i },
862 { "glVertex2iv", (GLvoid *) glVertex2iv },
863 { "glVertex2s", (GLvoid *) glVertex2s },
864 { "glVertex2sv", (GLvoid *) glVertex2sv },
865 { "glVertex3d", (GLvoid *) glVertex3d },
866 { "glVertex3dv", (GLvoid *) glVertex3dv },
867 { "glVertex3f", (GLvoid *) glVertex3f },
868 { "glVertex3fv", (GLvoid *) glVertex3fv },
869 { "glVertex3i", (GLvoid *) glVertex3i },
870 { "glVertex3iv", (GLvoid *) glVertex3iv },
871 { "glVertex3s", (GLvoid *) glVertex3s },
872 { "glVertex3sv", (GLvoid *) glVertex3sv },
873 { "glVertex4d", (GLvoid *) glVertex4d },
874 { "glVertex4dv", (GLvoid *) glVertex4dv },
875 { "glVertex4f", (GLvoid *) glVertex4f },
876 { "glVertex4fv", (GLvoid *) glVertex4fv },
877 { "glVertex4i", (GLvoid *) glVertex4i },
878 { "glVertex4iv", (GLvoid *) glVertex4iv },
879 { "glVertex4s", (GLvoid *) glVertex4s },
880 { "glVertex4sv", (GLvoid *) glVertex4sv },
881 { "glViewport", (GLvoid *) glViewport },
882
883 /* GL 1.1 */
884 #ifdef GL_VERSION_1_1
885 #define NAME(X) X
886 #else
887 #define NAME(X) NotImplemented
888 #endif
889 { "glAreTexturesResident", (GLvoid *) NAME(glAreTexturesResident) },
890 { "glArrayElement", (GLvoid *) NAME(glArrayElement) },
891 { "glBindTexture", (GLvoid *) NAME(glBindTexture) },
892 { "glColorPointer", (GLvoid *) NAME(glColorPointer) },
893 { "glCopyTexImage1D", (GLvoid *) NAME(glCopyTexImage1D) },
894 { "glCopyTexImage2D", (GLvoid *) NAME(glCopyTexImage2D) },
895 { "glCopyTexSubImage1D", (GLvoid *) NAME(glCopyTexSubImage1D) },
896 { "glCopyTexSubImage2D", (GLvoid *) NAME(glCopyTexSubImage2D) },
897 { "glDeleteTextures", (GLvoid *) NAME(glDeleteTextures) },
898 { "glDisableClientState", (GLvoid *) NAME(glDisableClientState) },
899 { "glDrawArrays", (GLvoid *) NAME(glDrawArrays) },
900 { "glDrawElements", (GLvoid *) NAME(glDrawElements) },
901 { "glEdgeFlagPointer", (GLvoid *) NAME(glEdgeFlagPointer) },
902 { "glEnableClientState", (GLvoid *) NAME(glEnableClientState) },
903 { "glGenTextures", (GLvoid *) NAME(glGenTextures) },
904 { "glGetPointerv", (GLvoid *) NAME(glGetPointerv) },
905 { "glIndexPointer", (GLvoid *) NAME(glIndexPointer) },
906 { "glIndexub", (GLvoid *) NAME(glIndexub) },
907 { "glIndexubv", (GLvoid *) NAME(glIndexubv) },
908 { "glInterleavedArrays", (GLvoid *) NAME(glInterleavedArrays) },
909 { "glIsTexture", (GLvoid *) NAME(glIsTexture) },
910 { "glNormalPointer", (GLvoid *) NAME(glNormalPointer) },
911 { "glPopClientAttrib", (GLvoid *) NAME(glPopClientAttrib) },
912 { "glPrioritizeTextures", (GLvoid *) NAME(glPrioritizeTextures) },
913 { "glPushClientAttrib", (GLvoid *) NAME(glPushClientAttrib) },
914 { "glTexCoordPointer", (GLvoid *) NAME(glTexCoordPointer) },
915 { "glTexSubImage1D", (GLvoid *) NAME(glTexSubImage1D) },
916 { "glTexSubImage2D", (GLvoid *) NAME(glTexSubImage2D) },
917 { "glVertexPointer", (GLvoid *) NAME(glVertexPointer) },
918 #undef NAME
919
920 /* GL 1.2 */
921 #ifdef GL_VERSION_1_2
922 #define NAME(X) X
923 #else
924 #define NAME(X) NotImplemented
925 #endif
926 { "glCopyTexSubImage3D", (GLvoid *) NAME(glCopyTexSubImage3D) },
927 { "glDrawRangeElements", (GLvoid *) NAME(glDrawRangeElements) },
928 { "glTexImage3D", (GLvoid *) NAME(glTexImage3D) },
929 { "glTexSubImage3D", (GLvoid *) NAME(glTexSubImage3D) },
930 #undef NAME
931
932 /* GL_ARB_imaging */
933 #ifdef GL_ARB_imaging
934 #define NAME(X) X
935 #else
936 #define NAME(X) NotImplemented
937 #endif
938 { "glBlendColor", (GLvoid *) NAME(glBlendColor) },
939 { "glBlendEquation", (GLvoid *) NAME(glBlendEquation) },
940 { "glColorSubTable", (GLvoid *) NAME(glColorSubTable) },
941 { "glColorTable", (GLvoid *) NAME(glColorTable) },
942 { "glColorTableParameterfv", (GLvoid *) NAME(glColorTableParameterfv) },
943 { "glColorTableParameteriv", (GLvoid *) NAME(glColorTableParameteriv) },
944 { "glConvolutionFilter1D", (GLvoid *) NAME(glConvolutionFilter1D) },
945 { "glConvolutionFilter2D", (GLvoid *) NAME(glConvolutionFilter2D) },
946 { "glConvolutionParameterf", (GLvoid *) NAME(glConvolutionParameterf) },
947 { "glConvolutionParameterfv", (GLvoid *) NAME(glConvolutionParameterfv) },
948 { "glConvolutionParameteri", (GLvoid *) NAME(glConvolutionParameteri) },
949 { "glConvolutionParameteriv", (GLvoid *) NAME(glConvolutionParameteriv) },
950 { "glCopyColorSubTable", (GLvoid *) NAME(glCopyColorSubTable) },
951 { "glCopyColorTable", (GLvoid *) NAME(glCopyColorTable) },
952 { "glCopyConvolutionFilter1D", (GLvoid *) NAME(glCopyConvolutionFilter1D) },
953 { "glCopyConvolutionFilter2D", (GLvoid *) NAME(glCopyConvolutionFilter2D) },
954 { "glGetColorTable", (GLvoid *) NAME(glGetColorTable) },
955 { "glGetColorTableParameterfv", (GLvoid *) NAME(glGetColorTableParameterfv) },
956 { "glGetColorTableParameteriv", (GLvoid *) NAME(glGetColorTableParameteriv) },
957 { "glGetConvolutionFilter", (GLvoid *) NAME(glGetConvolutionFilter) },
958 { "glGetConvolutionParameterfv", (GLvoid *) NAME(glGetConvolutionParameterfv) },
959 { "glGetConvolutionParameteriv", (GLvoid *) NAME(glGetConvolutionParameteriv) },
960 { "glGetHistogram", (GLvoid *) NAME(glGetHistogram) },
961 { "glGetHistogramParameterfv", (GLvoid *) NAME(glGetHistogramParameterfv) },
962 { "glGetHistogramParameteriv", (GLvoid *) NAME(glGetHistogramParameteriv) },
963 { "glGetMinmax", (GLvoid *) NAME(glGetMinmax) },
964 { "glGetMinmaxParameterfv", (GLvoid *) NAME(glGetMinmaxParameterfv) },
965 { "glGetMinmaxParameteriv", (GLvoid *) NAME(glGetMinmaxParameteriv) },
966 { "glGetSeparableFilter", (GLvoid *) NAME(glGetSeparableFilter) },
967 { "glHistogram", (GLvoid *) NAME(glHistogram) },
968 { "glMinmax", (GLvoid *) NAME(glMinmax) },
969 { "glResetHistogram", (GLvoid *) NAME(glResetHistogram) },
970 { "glResetMinmax", (GLvoid *) NAME(glResetMinmax) },
971 { "glSeparableFilter2D", (GLvoid *) NAME(glSeparableFilter2D) },
972 #undef NAME
973
974 /* GL_ARB_multitexture */
975 #ifdef GL_ARB_multitexture
976 #define NAME(X) X
977 #else
978 #define NAME(X) NotImplemented
979 #endif
980 { "glActiveTextureARB", (GLvoid *) NAME(glActiveTextureARB) },
981 { "glClientActiveTextureARB", (GLvoid *) NAME(glClientActiveTextureARB) },
982 { "glMultiTexCoord1dARB", (GLvoid *) NAME(glMultiTexCoord1dARB) },
983 { "glMultiTexCoord1dvARB", (GLvoid *) NAME(glMultiTexCoord1dvARB) },
984 { "glMultiTexCoord1fARB", (GLvoid *) NAME(glMultiTexCoord1fARB) },
985 { "glMultiTexCoord1fvARB", (GLvoid *) NAME(glMultiTexCoord1fvARB) },
986 { "glMultiTexCoord1iARB", (GLvoid *) NAME(glMultiTexCoord1iARB) },
987 { "glMultiTexCoord1ivARB", (GLvoid *) NAME(glMultiTexCoord1ivARB) },
988 { "glMultiTexCoord1sARB", (GLvoid *) NAME(glMultiTexCoord1sARB) },
989 { "glMultiTexCoord1svARB", (GLvoid *) NAME(glMultiTexCoord1svARB) },
990 { "glMultiTexCoord2dARB", (GLvoid *) NAME(glMultiTexCoord2dARB) },
991 { "glMultiTexCoord2dvARB", (GLvoid *) NAME(glMultiTexCoord2dvARB) },
992 { "glMultiTexCoord2fARB", (GLvoid *) NAME(glMultiTexCoord2fARB) },
993 { "glMultiTexCoord2fvARB", (GLvoid *) NAME(glMultiTexCoord2fvARB) },
994 { "glMultiTexCoord2iARB", (GLvoid *) NAME(glMultiTexCoord2iARB) },
995 { "glMultiTexCoord2ivARB", (GLvoid *) NAME(glMultiTexCoord2ivARB) },
996 { "glMultiTexCoord2sARB", (GLvoid *) NAME(glMultiTexCoord2sARB) },
997 { "glMultiTexCoord2svARB", (GLvoid *) NAME(glMultiTexCoord2svARB) },
998 { "glMultiTexCoord3dARB", (GLvoid *) NAME(glMultiTexCoord3dARB) },
999 { "glMultiTexCoord3dvARB", (GLvoid *) NAME(glMultiTexCoord3dvARB) },
1000 { "glMultiTexCoord3fARB", (GLvoid *) NAME(glMultiTexCoord3fARB) },
1001 { "glMultiTexCoord3fvARB", (GLvoid *) NAME(glMultiTexCoord3fvARB) },
1002 { "glMultiTexCoord3iARB", (GLvoid *) NAME(glMultiTexCoord3iARB) },
1003 { "glMultiTexCoord3ivARB", (GLvoid *) NAME(glMultiTexCoord3ivARB) },
1004 { "glMultiTexCoord3sARB", (GLvoid *) NAME(glMultiTexCoord3sARB) },
1005 { "glMultiTexCoord3svARB", (GLvoid *) NAME(glMultiTexCoord3svARB) },
1006 { "glMultiTexCoord4dARB", (GLvoid *) NAME(glMultiTexCoord4dARB) },
1007 { "glMultiTexCoord4dvARB", (GLvoid *) NAME(glMultiTexCoord4dvARB) },
1008 { "glMultiTexCoord4fARB", (GLvoid *) NAME(glMultiTexCoord4fARB) },
1009 { "glMultiTexCoord4fvARB", (GLvoid *) NAME(glMultiTexCoord4fvARB) },
1010 { "glMultiTexCoord4iARB", (GLvoid *) NAME(glMultiTexCoord4iARB) },
1011 { "glMultiTexCoord4ivARB", (GLvoid *) NAME(glMultiTexCoord4ivARB) },
1012 { "glMultiTexCoord4sARB", (GLvoid *) NAME(glMultiTexCoord4sARB) },
1013 { "glMultiTexCoord4svARB", (GLvoid *) NAME(glMultiTexCoord4svARB) },
1014 #undef NAME
1015
1016 /* 2. GL_EXT_blend_color */
1017 #ifdef GL_EXT_blend_color
1018 #define NAME(X) X
1019 #else
1020 #define NAME(X) NotImplemented
1021 #endif
1022 { "glBlendColorEXT", (GLvoid *) NAME(glBlendColorEXT) },
1023 #undef NAME
1024
1025 /* 3. GL_EXT_polygon_offset */
1026 #ifdef GL_EXT_polygon_offset
1027 #define NAME(X) X
1028 #else
1029 #define NAME(X) NotImplemented
1030 #endif
1031 { "glPolygonOffsetEXT", (GLvoid *) NAME(glPolygonOffsetEXT) },
1032 #undef NAME
1033
1034 /* 6. GL_EXT_texture3D */
1035 #ifdef GL_EXT_texture3D
1036 #define NAME(X) X
1037 #else
1038 #define NAME(X) NotImplemented
1039 #endif
1040 { "glCopyTexSubImage3DEXT", (GLvoid *) NAME(glCopyTexSubImage3DEXT) },
1041 { "glTexImage3DEXT", (GLvoid *) NAME(glTexImage3DEXT) },
1042 { "glTexSubImage3DEXT", (GLvoid *) NAME(glTexSubImage3DEXT) },
1043 #undef NAME
1044
1045 /* 7. GL_SGI_texture_filter4 */
1046 #ifdef GL_SGI_texture_filter4
1047 #define NAME(X) X
1048 #else
1049 #define NAME(X) NotImplemented
1050 #endif
1051 { "glGetTexFilterFuncSGIS", (GLvoid *) NAME(glGetTexFilterFuncSGIS) },
1052 { "glTexFilterFuncSGIS", (GLvoid *) NAME(glTexFilterFuncSGIS) },
1053 #undef NAME
1054
1055 /* 9. GL_EXT_subtexture */
1056 #ifdef GL_EXT_subtexture
1057 #define NAME(X) X
1058 #else
1059 #define NAME(X) NotImplemented
1060 #endif
1061 { "glTexSubImage1DEXT", (GLvoid *) NAME(glTexSubImage1DEXT) },
1062 { "glTexSubImage2DEXT", (GLvoid *) NAME(glTexSubImage2DEXT) },
1063 #undef NAME
1064
1065 /* 10. GL_EXT_copy_texture */
1066 #ifdef GL_EXT_copy_texture
1067 #define NAME(X) X
1068 #else
1069 #define NAME(X) NotImplemented
1070 #endif
1071 { "glCopyTexImage1DEXT", (GLvoid *) NAME(glCopyTexImage1DEXT) },
1072 { "glCopyTexImage2DEXT", (GLvoid *) NAME(glCopyTexImage2DEXT) },
1073 { "glCopyTexSubImage1DEXT", (GLvoid *) NAME(glCopyTexSubImage1DEXT) },
1074 { "glCopyTexSubImage2DEXT", (GLvoid *) NAME(glCopyTexSubImage2DEXT) },
1075 #undef NAME
1076
1077 /* 11. GL_EXT_histogram */
1078 #ifdef GL_EXT_histogram
1079 #define NAME(X) X
1080 #else
1081 #define NAME(X) NotImplemented
1082 #endif
1083 { "glGetHistogramEXT", (GLvoid *) NAME(glGetHistogramEXT) },
1084 { "glGetHistogramParameterfvEXT", (GLvoid *) NAME(glGetHistogramParameterfvEXT) },
1085 { "glGetHistogramParameterivEXT", (GLvoid *) NAME(glGetHistogramParameterivEXT) },
1086 { "glGetMinmaxEXT", (GLvoid *) NAME(glGetMinmaxEXT) },
1087 { "glGetMinmaxParameterfvEXT", (GLvoid *) NAME(glGetMinmaxParameterfvEXT) },
1088 { "glGetMinmaxParameterivEXT", (GLvoid *) NAME(glGetMinmaxParameterivEXT) },
1089 { "glHistogramEXT", (GLvoid *) NAME(glHistogramEXT) },
1090 { "glMinmaxEXT", (GLvoid *) NAME(glMinmaxEXT) },
1091 { "glResetHistogramEXT", (GLvoid *) NAME(glResetHistogramEXT) },
1092 { "glResetMinmaxEXT", (GLvoid *) NAME(glResetMinmaxEXT) },
1093 #undef NAME
1094
1095 /* 12. GL_EXT_convolution */
1096 #ifdef GL_EXT_convolution
1097 #define NAME(X) X
1098 #else
1099 #define NAME(X) NotImplemented
1100 #endif
1101 { "glConvolutionFilter1DEXT", (GLvoid *) NAME(glConvolutionFilter1DEXT) },
1102 { "glConvolutionFilter2DEXT", (GLvoid *) NAME(glConvolutionFilter2DEXT) },
1103 { "glConvolutionParameterfEXT", (GLvoid *) NAME(glConvolutionParameterfEXT) },
1104 { "glConvolutionParameterfvEXT", (GLvoid *) NAME(glConvolutionParameterfvEXT) },
1105 { "glConvolutionParameteriEXT", (GLvoid *) NAME(glConvolutionParameteriEXT) },
1106 { "glConvolutionParameterivEXT", (GLvoid *) NAME(glConvolutionParameterivEXT) },
1107 { "glCopyConvolutionFilter1DEXT", (GLvoid *) NAME(glCopyConvolutionFilter1DEXT) },
1108 { "glCopyConvolutionFilter2DEXT", (GLvoid *) NAME(glCopyConvolutionFilter2DEXT) },
1109 { "glGetConvolutionFilterEXT", (GLvoid *) NAME(glGetConvolutionFilterEXT) },
1110 { "glGetConvolutionParameterivEXT", (GLvoid *) NAME(glGetConvolutionParameterivEXT) },
1111 { "glGetConvolutionParameterfvEXT", (GLvoid *) NAME(glGetConvolutionParameterfvEXT) },
1112 { "glGetSeparableFilterEXT", (GLvoid *) NAME(glGetSeparableFilterEXT) },
1113 { "glSeparableFilter2DEXT", (GLvoid *) NAME(glSeparableFilter2DEXT) },
1114 #undef NAME
1115
1116 /* 14. GL_SGI_color_table */
1117 #ifdef GL_SGI_color_table
1118 #define NAME(X) X
1119 #else
1120 #define NAME(X) NotImplemented
1121 #endif
1122 { "glColorTableSGI", (GLvoid *) NAME(glColorTableSGI) },
1123 { "glColorTableParameterfvSGI", (GLvoid *) NAME(glColorTableParameterfvSGI) },
1124 { "glColorTableParameterivSGI", (GLvoid *) NAME(glColorTableParameterivSGI) },
1125 { "glCopyColorTableSGI", (GLvoid *) NAME(glCopyColorTableSGI) },
1126 { "glGetColorTableSGI", (GLvoid *) NAME(glGetColorTableSGI) },
1127 { "glGetColorTableParameterfvSGI", (GLvoid *) NAME(glGetColorTableParameterfvSGI) },
1128 { "glGetColorTableParameterivSGI", (GLvoid *) NAME(glGetColorTableParameterivSGI) },
1129 #undef NAME
1130
1131 /* 15. GL_SGIS_pixel_texture */
1132 #ifdef GL_SGIS_pixel_texture
1133 #define NAME(X) X
1134 #else
1135 #define NAME(X) NotImplemented
1136 #endif
1137 { "glPixelTexGenParameterfSGIS", (GLvoid *) NAME(glPixelTexGenParameterfSGIS) },
1138 { "glPixelTexGenParameteriSGIS", (GLvoid *) NAME(glPixelTexGenParameteriSGIS) },
1139 { "glGetPixelTexGenParameterfvSGIS", (GLvoid *) NAME(glGetPixelTexGenParameterfvSGIS) },
1140 { "glGetPixelTexGenParameterivSGIS", (GLvoid *) NAME(glGetPixelTexGenParameterivSGIS) },
1141 #undef NAME
1142
1143 /* 16. GL_SGIS_texture4D */
1144 #ifdef GL_SGIS_texture4D
1145 #define NAME(X) X
1146 #else
1147 #define NAME(X) NotImplemented
1148 #endif
1149 { "glTexImage4DSGIS", (GLvoid *) NAME(glTexImage4DSGIS) },
1150 { "glTexSubImage4DSGIS", (GLvoid *) NAME(glTexSubImage4DSGIS) },
1151 #undef NAME
1152
1153 /* 20. GL_EXT_texture_object */
1154 #ifdef GL_EXT_texture_object
1155 #define NAME(X) X
1156 #else
1157 #define NAME(X) NotImplemented
1158 #endif
1159 { "glAreTexturesResidentEXT", (GLvoid *) NAME(glAreTexturesResidentEXT) },
1160 { "glBindTextureEXT", (GLvoid *) NAME(glBindTextureEXT) },
1161 { "glDeleteTexturesEXT", (GLvoid *) NAME(glDeleteTexturesEXT) },
1162 { "glGenTexturesEXT", (GLvoid *) NAME(glGenTexturesEXT) },
1163 { "glIsTextureEXT", (GLvoid *) NAME(glIsTextureEXT) },
1164 { "glPrioritizeTexturesEXT", (GLvoid *) NAME(glPrioritizeTexturesEXT) },
1165 #undef NAME
1166
1167 /* 21. GL_SGIS_detail_texture */
1168 #ifdef GL_SGIS_detail_texture
1169 #define NAME(X) X
1170 #else
1171 #define NAME(X) NotImplemented
1172 #endif
1173 { "glDetailTexFuncSGIS", (GLvoid *) NAME(glDetailTexFuncSGIS) },
1174 { "glGetDetailTexFuncSGIS", (GLvoid *) NAME(glGetDetailTexFuncSGIS) },
1175 #undef NAME
1176
1177 /* 22. GL_SGIS_sharpen_texture */
1178 #ifdef GL_SGIS_sharpen_texture
1179 #define NAME(X) X
1180 #else
1181 #define NAME(X) NotImplemented
1182 #endif
1183 { "glGetSharpenTexFuncSGIS", (GLvoid *) NAME(glGetSharpenTexFuncSGIS) },
1184 { "glSharpenTexFuncSGIS", (GLvoid *) NAME(glSharpenTexFuncSGIS) },
1185 #undef NAME
1186
1187 /* 25. GL_SGIS_multisample */
1188 #ifdef GL_SGIS_multisample
1189 #define NAME(X) X
1190 #else
1191 #define NAME(X) NotImplemented
1192 #endif
1193 { "glSampleMaskSGIS", (GLvoid *) NAME(glSampleMaskSGIS) },
1194 { "glSamplePatternSGIS", (GLvoid *) NAME(glSamplePatternSGIS) },
1195 #undef NAME
1196
1197 /* 30. GL_EXT_vertex_array */
1198 #ifdef GL_EXT_vertex_array
1199 #define NAME(X) X
1200 #else
1201 #define NAME(X) NotImplemented
1202 #endif
1203 { "glArrayElementEXT", (GLvoid *) NAME(glArrayElementEXT) },
1204 { "glColorPointerEXT", (GLvoid *) NAME(glColorPointerEXT) },
1205 { "glDrawArraysEXT", (GLvoid *) NAME(glDrawArraysEXT) },
1206 { "glEdgeFlagPointerEXT", (GLvoid *) NAME(glEdgeFlagPointerEXT) },
1207 { "glGetPointervEXT", (GLvoid *) NAME(glGetPointervEXT) },
1208 { "glIndexPointerEXT", (GLvoid *) NAME(glIndexPointerEXT) },
1209 { "glNormalPointerEXT", (GLvoid *) NAME(glNormalPointerEXT) },
1210 { "glTexCoordPointerEXT", (GLvoid *) NAME(glTexCoordPointerEXT) },
1211 { "glVertexPointerEXT", (GLvoid *) NAME(glVertexPointerEXT) },
1212 #undef NAME
1213
1214 /* 37. GL_EXT_blend_minmax */
1215 #ifdef GL_EXT_blend_minmax
1216 #define NAME(X) X
1217 #else
1218 #define NAME(X) NotImplemented
1219 #endif
1220 { "glBlendEquationEXT", (GLvoid *) NAME(glBlendEquationEXT) },
1221 #undef NAME
1222
1223 /* 52. GL_SGIX_sprite */
1224 #ifdef GL_SGIX_sprite
1225 #define NAME(X) X
1226 #else
1227 #define NAME(X) NotImplemented
1228 #endif
1229 { "glSpriteParameterfSGIX", (GLvoid *) NAME(glSpriteParameterfSGIX) },
1230 { "glSpriteParameterfvSGIX", (GLvoid *) NAME(glSpriteParameterfvSGIX) },
1231 { "glSpriteParameteriSGIX", (GLvoid *) NAME(glSpriteParameteriSGIX) },
1232 { "glSpriteParameterivSGIX", (GLvoid *) NAME(glSpriteParameterivSGIX) },
1233 #undef NAME
1234
1235 /* 54. GL_EXT_point_parameters */
1236 #ifdef GL_EXT_point_parameters
1237 #define NAME(X) X
1238 #else
1239 #define NAME(X) NotImplemented
1240 #endif
1241 { "glPointParameterfEXT", (GLvoid *) NAME(glPointParameterfEXT) },
1242 { "glPointParameterfvEXT", (GLvoid *) NAME(glPointParameterfvEXT) },
1243 #undef NAME
1244
1245 /* 55. GL_SGIX_instruments */
1246 #ifdef GL_SGIX_instruments
1247 #define NAME(X) X
1248 #else
1249 #define NAME(X) NotImplemented
1250 #endif
1251 { "glInstrumentsBufferSGIX", (GLvoid *) NAME(glInstrumentsBufferSGIX) },
1252 { "glStartInstrumentsSGIX", (GLvoid *) NAME(glStartInstrumentsSGIX) },
1253 { "glStopInstrumentsSGIX", (GLvoid *) NAME(glStopInstrumentsSGIX) },
1254 { "glReadInstrumentsSGIX", (GLvoid *) NAME(glReadInstrumentsSGIX) },
1255 { "glPollInstrumentsSGIX", (GLvoid *) NAME(glPollInstrumentsSGIX) },
1256 { "glGetInstrumentsSGIX", (GLvoid *) NAME(glGetInstrumentsSGIX) },
1257 #undef NAME
1258
1259 /* 57. GL_SGIX_framezoom */
1260 #ifdef GL_SGIX_framezoom
1261 #define NAME(X) X
1262 #else
1263 #define NAME(X) NotImplemented
1264 #endif
1265 { "glFrameZoomSGIX", (GLvoid *) NAME(glFrameZoomSGIX) },
1266 #undef NAME
1267
1268 /* 60. GL_SGIX_reference_plane */
1269 #ifdef GL_SGIX_reference_plane
1270 #define NAME(X) X
1271 #else
1272 #define NAME(X) NotImplemented
1273 #endif
1274 { "glReferencePlaneSGIX", (GLvoid *) NAME(glReferencePlaneSGIX) },
1275 #undef NAME
1276
1277 /* 61. GL_SGIX_flush_raster */
1278 #ifdef GL_SGIX_flush_raster
1279 #define NAME(X) X
1280 #else
1281 #define NAME(X) NotImplemented
1282 #endif
1283 { "glFlushRasterSGIX", (GLvoid *) NAME(glFlushRasterSGIX) },
1284 #undef NAME
1285
1286 /* 66. GL_HP_image_transform */
1287 #ifdef GL_HP_image_transform
1288 #define NAME(X) X
1289 #else
1290 #define NAME(X) NotImplemented
1291 #endif
1292 { "glGetImageTransformParameterfvHP", (GLvoid *) NAME(glGetImageTransformParameterfvHP) },
1293 { "glGetImageTransformParameterivHP", (GLvoid *) NAME(glGetImageTransformParameterivHP) },
1294 { "glImageTransformParameterfHP", (GLvoid *) NAME(glImageTransformParameterfHP) },
1295 { "glImageTransformParameterfvHP", (GLvoid *) NAME(glImageTransformParameterfvHP) },
1296 { "glImageTransformParameteriHP", (GLvoid *) NAME(glImageTransformParameteriHP) },
1297 { "glImageTransformParameterivHP", (GLvoid *) NAME(glImageTransformParameterivHP) },
1298 #undef NAME
1299
1300 /* 74. GL_EXT_color_subtable */
1301 #ifdef GL_EXT_color_subtable
1302 #define NAME(X) X
1303 #else
1304 #define NAME(X) NotImplemented
1305 #endif
1306 { "glColorSubTableEXT", (GLvoid *) NAME(glColorSubTableEXT) },
1307 { "glCopyColorSubTableEXT", (GLvoid *) NAME(glCopyColorSubTableEXT) },
1308 #undef NAME
1309
1310 /* 77. GL_PGI_misc_hints */
1311 #ifdef GL_PGI_misc_hints
1312 #define NAME(X) X
1313 #else
1314 #define NAME(X) NotImplemented
1315 #endif
1316 { "glHintPGI", (GLvoid *) NAME(glHintPGI) },
1317 #undef NAME
1318
1319 /* 78. GL_EXT_paletted_texture */
1320 #ifdef GL_EXT_paletted_texture
1321 #define NAME(X) X
1322 #else
1323 #define NAME(X) NotImplemented
1324 #endif
1325 { "glColorTableEXT", (GLvoid *) NAME(glColorTableEXT) },
1326 { "glGetColorTableEXT", (GLvoid *) NAME(glGetColorTableEXT) },
1327 { "glGetColorTableParameterfvEXT", (GLvoid *) NAME(glGetColorTableParameterfvEXT) },
1328 { "glGetColorTableParameterivEXT", (GLvoid *) NAME(glGetColorTableParameterivEXT) },
1329 #undef NAME
1330
1331 /* 80. GL_SGIX_list_priority */
1332 #ifdef GL_SGIX_list_priority
1333 #define NAME(X) X
1334 #else
1335 #define NAME(X) NotImplemented
1336 #endif
1337 { "glGetListParameterfvSGIX", (GLvoid *) NAME(glGetListParameterfvSGIX) },
1338 { "glGetListParameterivSGIX", (GLvoid *) NAME(glGetListParameterivSGIX) },
1339 { "glListParameterfSGIX", (GLvoid *) NAME(glListParameterfSGIX) },
1340 { "glListParameterfvSGIX", (GLvoid *) NAME(glListParameterfvSGIX) },
1341 { "glListParameteriSGIX", (GLvoid *) NAME(glListParameteriSGIX) },
1342 { "glListParameterivSGIX", (GLvoid *) NAME(glListParameterivSGIX) },
1343 #undef NAME
1344
1345 /* 94. GL_EXT_index_material */
1346 #ifdef GL_EXT_index_material
1347 #define NAME(X) X
1348 #else
1349 #define NAME(X) NotImplemented
1350 #endif
1351 { "glIndexMaterialEXT", (GLvoid *) NAME(glIndexMaterialEXT) },
1352 #undef NAME
1353
1354 /* 95. GL_EXT_index_func */
1355 #ifdef GL_EXT_index_func
1356 #define NAME(X) X
1357 #else
1358 #define NAME(X) NotImplemented
1359 #endif
1360 { "glIndexFuncEXT", (GLvoid *) NAME(glIndexFuncEXT) },
1361 #undef NAME
1362
1363 /* 97. GL_EXT_compiled_vertex_array */
1364 #ifdef GL_EXT_compiled_vertex_array
1365 #define NAME(X) X
1366 #else
1367 #define NAME(X) NotImplemented
1368 #endif
1369 { "glLockArraysEXT", (GLvoid *) NAME(glLockArraysEXT) },
1370 { "glUnlockArraysEXT", (GLvoid *) NAME(glUnlockArraysEXT) },
1371 #undef NAME
1372
1373 /* 98. GL_EXT_cull_vertex */
1374 #ifdef GL_EXT_cull_vertex
1375 #define NAME(X) X
1376 #else
1377 #define NAME(X) NotImplemented
1378 #endif
1379 { "glCullParameterfvEXT", (GLvoid *) NAME(glCullParameterfvEXT) },
1380 { "glCullParameterdvEXT", (GLvoid *) NAME(glCullParameterdvEXT) },
1381 #undef NAME
1382
1383 /* 173. GL_EXT/INGR_blend_func_separate */
1384 #ifdef GL_INGR_blend_func_separate
1385 #define NAME(X) X
1386 #else
1387 #define NAME(X) NotImplemented
1388 #endif
1389 { "glBlendFuncSeparateINGR", (GLvoid *) NAME(glBlendFuncSeparateINGR) },
1390 #undef NAME
1391
1392 /* GL_MESA_window_pos */
1393 #ifdef MESA_window_pos
1394 #define NAME(X) X
1395 #else
1396 #define NAME(X) NotImplemented
1397 #endif
1398 { "glWindowPos4fMESA", (GLvoid *) NAME(glWindowPos4fMESA) },
1399 #undef NAME
1400
1401 /* GL_MESA_resize_buffers */
1402 #ifdef MESA_resize_buffers
1403 #define NAME(X) X
1404 #else
1405 #define NAME(X) NotImplemented
1406 #endif
1407 { "glResizeBuffersMESA", (GLvoid *) NAME(glResizeBuffersMESA) },
1408 #undef NAME
1409
1410 /* GL_ARB_transpose_matrix */
1411 #ifdef GL_ARB_transpose_matrix
1412 #define NAME(X) X
1413 #else
1414 #define NAME(X) NotImplemented
1415 #endif
1416 { "glLoadTransposeMatrixdARB", (GLvoid *) NAME(glLoadTransposeMatrixdARB) },
1417 { "glLoadTransposeMatrixfARB", (GLvoid *) NAME(glLoadTransposeMatrixfARB) },
1418 { "glMultTransposeMatrixdARB", (GLvoid *) NAME(glMultTransposeMatrixdARB) },
1419 { "glMultTransposeMatrixfARB", (GLvoid *) NAME(glMultTransposeMatrixfARB) },
1420 #undef NAME
1421
1422 /*
1423 * XXX many more extenstion functions to add.
1424 */
1425
1426 { NULL, NULL } /* end of list marker */
1427 };
1428