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