fc1ab6c3163b31746ed4b1811ee2a51777385e3e
[mesa.git] / src / mesa / glapi / glapi.c
1 /* $Id: glapi.c,v 1.34 2000/02/12 17:31:40 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 /* Make sure we don't try to add a new entrypoint after someone
349 * has already called _glapi_get_dispatch_table_size()! If that's
350 * happened the caller's information will now be out of date.
351 */
352 assert(!GetSizeCalled);
353
354 /* first check if the named function is already statically present */
355 {
356 GLint index = get_static_proc_offset(funcName);
357 if (index >= 0) {
358 return (GLboolean) (index == offset); /* bad offset! */
359 }
360 }
361
362 {
363 /* make sure this offset/name pair is legal */
364 const char *name = _glapi_get_proc_name(offset);
365 if (name && strcmp(name, funcName) != 0)
366 return GL_FALSE; /* bad name! */
367 }
368
369 {
370 /* be sure index and name match known data */
371 GLuint i;
372 for (i = 0; i < NumExtEntryPoints; i++) {
373 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
374 /* function already registered with api */
375 if (ExtEntryTable[i].Offset == offset) {
376 return GL_TRUE; /* offsets match */
377 }
378 else {
379 return GL_FALSE; /* bad offset! */
380 }
381 }
382 }
383
384 /* make sure we have space */
385 if (NumExtEntryPoints >= MAX_EXTENSION_FUNCS) {
386 return GL_FALSE;
387 }
388 else {
389 void *entrypoint = generate_entrypoint(offset);
390 if (!entrypoint)
391 return GL_FALSE;
392
393 ExtEntryTable[NumExtEntryPoints].Name = strdup(funcName);
394 ExtEntryTable[NumExtEntryPoints].Offset = offset;
395 ExtEntryTable[NumExtEntryPoints].Address = entrypoint;
396 NumExtEntryPoints++;
397
398 if (offset > MaxDispatchOffset)
399 MaxDispatchOffset = offset;
400
401 return GL_TRUE; /* success */
402 }
403 }
404
405 /* should never get here, but play it safe */
406 return GL_FALSE;
407 }
408
409
410
411 #if 0000 /* prototype code for dynamic extension slot allocation */
412
413 static int NextFreeOffset = 409; /*XXX*/
414 #define MAX_DISPATCH_TABLE_SIZE 1000
415
416 /*
417 * Dynamically allocate a dispatch slot for an extension entrypoint
418 * and generate the assembly language dispatch stub.
419 * Return the dispatch offset for the function or -1 if no room or error.
420 */
421 GLint
422 _glapi_add_entrypoint2(const char *funcName)
423 {
424 int offset;
425
426 /* first see if extension func is already known */
427 offset = _glapi_get_proc_offset(funcName);
428 if (offset >= 0)
429 return offset;
430
431 if (NumExtEntryPoints < MAX_EXTENSION_FUNCS
432 && NextFreeOffset < MAX_DISPATCH_TABLE_SIZE) {
433 void *entryPoint;
434 offset = NextFreeOffset;
435 entryPoint = generate_entrypoint(offset);
436 if (entryPoint) {
437 NextFreeOffset++;
438 ExtEntryTable[NumExtEntryPoints].Name = strdup(funcName);
439 ExtEntryTable[NumExtEntryPoints].Offset = offset;
440 ExtEntryTable[NumExtEntryPoints].Address = entryPoint;
441 NumExtEntryPoints++;
442 return offset;
443 }
444 }
445 return -1;
446 }
447
448 #endif
449
450
451
452 /*
453 * Return offset of entrypoint for named function within dispatch table.
454 */
455 GLint
456 _glapi_get_proc_offset(const char *funcName)
457 {
458 /* search extension functions first */
459 GLint i;
460 for (i = 0; i < NumExtEntryPoints; i++) {
461 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
462 return ExtEntryTable[i].Offset;
463 }
464 }
465
466 /* search static functions */
467 return get_static_proc_offset(funcName);
468 }
469
470
471
472 /*
473 * Return entrypoint for named function.
474 */
475 const GLvoid *
476 _glapi_get_proc_address(const char *funcName)
477 {
478 /* search extension functions first */
479 GLint i;
480 for (i = 0; i < NumExtEntryPoints; i++) {
481 if (strcmp(ExtEntryTable[i].Name, funcName) == 0) {
482 return ExtEntryTable[i].Address;
483 }
484 }
485
486 /* search static functions */
487 return get_static_proc_address(funcName);
488 }
489
490
491
492
493 /*
494 * Return the name of the function at the given dispatch offset.
495 * This is only intended for debugging.
496 */
497 const char *
498 _glapi_get_proc_name(GLuint offset)
499 {
500 GLuint n = sizeof(static_functions) / sizeof(struct name_address_pair);
501 if (offset < n) {
502 return static_functions[offset].Name;
503 }
504 else {
505 /* search added extension functions */
506 GLuint i;
507 for (i = 0; i < NumExtEntryPoints; i++) {
508 if (ExtEntryTable[i].Offset == offset) {
509 return ExtEntryTable[i].Name;
510 }
511 }
512 return NULL;
513 }
514 }
515
516
517
518 /*
519 * Make sure there are no NULL pointers in the given dispatch table.
520 * Intented for debugging purposes.
521 */
522 void
523 _glapi_check_table(const struct _glapi_table *table)
524 {
525 const GLuint entries = _glapi_get_dispatch_table_size();
526 const void **tab = (const void **) table;
527 GLuint i;
528 for (i = 1; i < entries; i++) {
529 assert(tab[i]);
530 }
531
532 #ifdef DEBUG
533 /* Do some spot checks to be sure that the dispatch table
534 * slots are assigned correctly.
535 */
536 {
537 GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
538 char *BeginFunc = (char*) &table->Begin;
539 GLuint offset = (BeginFunc - (char *) table) / sizeof(void *);
540 assert(BeginOffset == _gloffset_Begin);
541 assert(BeginOffset == offset);
542 }
543 {
544 GLuint viewportOffset = _glapi_get_proc_offset("glViewport");
545 char *viewportFunc = (char*) &table->Viewport;
546 GLuint offset = (viewportFunc - (char *) table) / sizeof(void *);
547 assert(viewportOffset == _gloffset_Viewport);
548 assert(viewportOffset == offset);
549 }
550 {
551 GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer");
552 char *VertexPointerFunc = (char*) &table->VertexPointer;
553 GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *);
554 assert(VertexPointerOffset == _gloffset_VertexPointer);
555 assert(VertexPointerOffset == offset);
556 }
557 {
558 GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax");
559 char *ResetMinMaxFunc = (char*) &table->ResetMinmax;
560 GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *);
561 assert(ResetMinMaxOffset == _gloffset_ResetMinmax);
562 assert(ResetMinMaxOffset == offset);
563 }
564 {
565 GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColorEXT");
566 char *blendColorFunc = (char*) &table->BlendColorEXT;
567 GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *);
568 assert(blendColorOffset == _gloffset_BlendColorEXT);
569 assert(blendColorOffset == offset);
570 }
571 {
572 GLuint istextureOffset = _glapi_get_proc_offset("glIsTextureEXT");
573 char *istextureFunc = (char*) &table->IsTextureEXT;
574 GLuint offset = (istextureFunc - (char *) table) / sizeof(void *);
575 assert(istextureOffset == _gloffset_IsTextureEXT);
576 assert(istextureOffset == offset);
577 }
578 #endif
579 }
580
581
582 /*
583 * For each entry in static_functions[] which use this function
584 * we should implement a dispatch function in glapitemp.h and
585 * in glapinoop.c
586 */
587 static int NotImplemented(void)
588 {
589 return 0;
590 }
591
592
593
594 static struct name_address_pair static_functions[] = {
595 { "NotImplemented", (GLvoid *) NotImplemented },
596
597 /* GL 1.1 */
598 { "glAccum", (GLvoid *) glAccum },
599 { "glAlphaFunc", (GLvoid *) glAlphaFunc },
600 { "glBegin", (GLvoid *) glBegin },
601 { "glBitmap", (GLvoid *) glBitmap },
602 { "glBlendFunc", (GLvoid *) glBlendFunc },
603 { "glCallList", (GLvoid *) glCallList },
604 { "glCallLists", (GLvoid *) glCallLists },
605 { "glClear", (GLvoid *) glClear },
606 { "glClearAccum", (GLvoid *) glClearAccum },
607 { "glClearColor", (GLvoid *) glClearColor },
608 { "glClearDepth", (GLvoid *) glClearDepth },
609 { "glClearIndex", (GLvoid *) glClearIndex },
610 { "glClearStencil", (GLvoid *) glClearStencil },
611 { "glClipPlane", (GLvoid *) glClipPlane },
612 { "glColor3b", (GLvoid *) glColor3b },
613 { "glColor3bv", (GLvoid *) glColor3bv },
614 { "glColor3d", (GLvoid *) glColor3d },
615 { "glColor3dv", (GLvoid *) glColor3dv },
616 { "glColor3f", (GLvoid *) glColor3f },
617 { "glColor3fv", (GLvoid *) glColor3fv },
618 { "glColor3i", (GLvoid *) glColor3i },
619 { "glColor3iv", (GLvoid *) glColor3iv },
620 { "glColor3s", (GLvoid *) glColor3s },
621 { "glColor3sv", (GLvoid *) glColor3sv },
622 { "glColor3ub", (GLvoid *) glColor3ub },
623 { "glColor3ubv", (GLvoid *) glColor3ubv },
624 { "glColor3ui", (GLvoid *) glColor3ui },
625 { "glColor3uiv", (GLvoid *) glColor3uiv },
626 { "glColor3us", (GLvoid *) glColor3us },
627 { "glColor3usv", (GLvoid *) glColor3usv },
628 { "glColor4b", (GLvoid *) glColor4b },
629 { "glColor4bv", (GLvoid *) glColor4bv },
630 { "glColor4d", (GLvoid *) glColor4d },
631 { "glColor4dv", (GLvoid *) glColor4dv },
632 { "glColor4f", (GLvoid *) glColor4f },
633 { "glColor4fv", (GLvoid *) glColor4fv },
634 { "glColor4i", (GLvoid *) glColor4i },
635 { "glColor4iv", (GLvoid *) glColor4iv },
636 { "glColor4s", (GLvoid *) glColor4s },
637 { "glColor4sv", (GLvoid *) glColor4sv },
638 { "glColor4ub", (GLvoid *) glColor4ub },
639 { "glColor4ubv", (GLvoid *) glColor4ubv },
640 { "glColor4ui", (GLvoid *) glColor4ui },
641 { "glColor4uiv", (GLvoid *) glColor4uiv },
642 { "glColor4us", (GLvoid *) glColor4us },
643 { "glColor4usv", (GLvoid *) glColor4usv },
644 { "glColorMask", (GLvoid *) glColorMask },
645 { "glColorMaterial", (GLvoid *) glColorMaterial },
646 { "glCopyPixels", (GLvoid *) glCopyPixels },
647 { "glCullFace", (GLvoid *) glCullFace },
648 { "glDeleteLists", (GLvoid *) glDeleteLists },
649 { "glDepthFunc", (GLvoid *) glDepthFunc },
650 { "glDepthMask", (GLvoid *) glDepthMask },
651 { "glDepthRange", (GLvoid *) glDepthRange },
652 { "glDisable", (GLvoid *) glDisable },
653 { "glDrawBuffer", (GLvoid *) glDrawBuffer },
654 { "glDrawPixels", (GLvoid *) glDrawPixels },
655 { "glEdgeFlag", (GLvoid *) glEdgeFlag },
656 { "glEdgeFlagv", (GLvoid *) glEdgeFlagv },
657 { "glEnable", (GLvoid *) glEnable },
658 { "glEnd", (GLvoid *) glEnd },
659 { "glEndList", (GLvoid *) glEndList },
660 { "glEvalCoord1d", (GLvoid *) glEvalCoord1d },
661 { "glEvalCoord1dv", (GLvoid *) glEvalCoord1dv },
662 { "glEvalCoord1f", (GLvoid *) glEvalCoord1f },
663 { "glEvalCoord1fv", (GLvoid *) glEvalCoord1fv },
664 { "glEvalCoord2d", (GLvoid *) glEvalCoord2d },
665 { "glEvalCoord2dv", (GLvoid *) glEvalCoord2dv },
666 { "glEvalCoord2f", (GLvoid *) glEvalCoord2f },
667 { "glEvalCoord2fv", (GLvoid *) glEvalCoord2fv },
668 { "glEvalMesh1", (GLvoid *) glEvalMesh1 },
669 { "glEvalMesh2", (GLvoid *) glEvalMesh2 },
670 { "glEvalPoint1", (GLvoid *) glEvalPoint1 },
671 { "glEvalPoint2", (GLvoid *) glEvalPoint2 },
672 { "glFeedbackBuffer", (GLvoid *) glFeedbackBuffer },
673 { "glFinish", (GLvoid *) glFinish },
674 { "glFlush", (GLvoid *) glFlush },
675 { "glFogf", (GLvoid *) glFogf },
676 { "glFogfv", (GLvoid *) glFogfv },
677 { "glFogi", (GLvoid *) glFogi },
678 { "glFogiv", (GLvoid *) glFogiv },
679 { "glFrontFace", (GLvoid *) glFrontFace },
680 { "glFrustum", (GLvoid *) glFrustum },
681 { "glGenLists", (GLvoid *) glGenLists },
682 { "glGetBooleanv", (GLvoid *) glGetBooleanv },
683 { "glGetClipPlane", (GLvoid *) glGetClipPlane },
684 { "glGetDoublev", (GLvoid *) glGetDoublev },
685 { "glGetError", (GLvoid *) glGetError },
686 { "glGetFloatv", (GLvoid *) glGetFloatv },
687 { "glGetIntegerv", (GLvoid *) glGetIntegerv },
688 { "glGetLightfv", (GLvoid *) glGetLightfv },
689 { "glGetLightiv", (GLvoid *) glGetLightiv },
690 { "glGetMapdv", (GLvoid *) glGetMapdv },
691 { "glGetMapfv", (GLvoid *) glGetMapfv },
692 { "glGetMapiv", (GLvoid *) glGetMapiv },
693 { "glGetMaterialfv", (GLvoid *) glGetMaterialfv },
694 { "glGetMaterialiv", (GLvoid *) glGetMaterialiv },
695 { "glGetPixelMapfv", (GLvoid *) glGetPixelMapfv },
696 { "glGetPixelMapuiv", (GLvoid *) glGetPixelMapuiv },
697 { "glGetPixelMapusv", (GLvoid *) glGetPixelMapusv },
698 { "glGetPolygonStipple", (GLvoid *) glGetPolygonStipple },
699 { "glGetString", (GLvoid *) glGetString },
700 { "glGetTexEnvfv", (GLvoid *) glGetTexEnvfv },
701 { "glGetTexEnviv", (GLvoid *) glGetTexEnviv },
702 { "glGetTexGendv", (GLvoid *) glGetTexGendv },
703 { "glGetTexGenfv", (GLvoid *) glGetTexGenfv },
704 { "glGetTexGeniv", (GLvoid *) glGetTexGeniv },
705 { "glGetTexImage", (GLvoid *) glGetTexImage },
706 { "glGetTexLevelParameterfv", (GLvoid *) glGetTexLevelParameterfv },
707 { "glGetTexLevelParameteriv", (GLvoid *) glGetTexLevelParameteriv },
708 { "glGetTexParameterfv", (GLvoid *) glGetTexParameterfv },
709 { "glGetTexParameteriv", (GLvoid *) glGetTexParameteriv },
710 { "glHint", (GLvoid *) glHint },
711 { "glIndexMask", (GLvoid *) glIndexMask },
712 { "glIndexd", (GLvoid *) glIndexd },
713 { "glIndexdv", (GLvoid *) glIndexdv },
714 { "glIndexf", (GLvoid *) glIndexf },
715 { "glIndexfv", (GLvoid *) glIndexfv },
716 { "glIndexi", (GLvoid *) glIndexi },
717 { "glIndexiv", (GLvoid *) glIndexiv },
718 { "glIndexs", (GLvoid *) glIndexs },
719 { "glIndexsv", (GLvoid *) glIndexsv },
720 { "glInitNames", (GLvoid *) glInitNames },
721 { "glIsEnabled", (GLvoid *) glIsEnabled },
722 { "glIsList", (GLvoid *) glIsList },
723 { "glLightModelf", (GLvoid *) glLightModelf },
724 { "glLightModelfv", (GLvoid *) glLightModelfv },
725 { "glLightModeli", (GLvoid *) glLightModeli },
726 { "glLightModeliv", (GLvoid *) glLightModeliv },
727 { "glLightf", (GLvoid *) glLightf },
728 { "glLightfv", (GLvoid *) glLightfv },
729 { "glLighti", (GLvoid *) glLighti },
730 { "glLightiv", (GLvoid *) glLightiv },
731 { "glLineStipple", (GLvoid *) glLineStipple },
732 { "glLineWidth", (GLvoid *) glLineWidth },
733 { "glListBase", (GLvoid *) glListBase },
734 { "glLoadIdentity", (GLvoid *) glLoadIdentity },
735 { "glLoadMatrixd", (GLvoid *) glLoadMatrixd },
736 { "glLoadMatrixf", (GLvoid *) glLoadMatrixf },
737 { "glLoadName", (GLvoid *) glLoadName },
738 { "glLogicOp", (GLvoid *) glLogicOp },
739 { "glMap1d", (GLvoid *) glMap1d },
740 { "glMap1f", (GLvoid *) glMap1f },
741 { "glMap2d", (GLvoid *) glMap2d },
742 { "glMap2f", (GLvoid *) glMap2f },
743 { "glMapGrid1d", (GLvoid *) glMapGrid1d },
744 { "glMapGrid1f", (GLvoid *) glMapGrid1f },
745 { "glMapGrid2d", (GLvoid *) glMapGrid2d },
746 { "glMapGrid2f", (GLvoid *) glMapGrid2f },
747 { "glMaterialf", (GLvoid *) glMaterialf },
748 { "glMaterialfv", (GLvoid *) glMaterialfv },
749 { "glMateriali", (GLvoid *) glMateriali },
750 { "glMaterialiv", (GLvoid *) glMaterialiv },
751 { "glMatrixMode", (GLvoid *) glMatrixMode },
752 { "glMultMatrixd", (GLvoid *) glMultMatrixd },
753 { "glMultMatrixf", (GLvoid *) glMultMatrixf },
754 { "glNewList", (GLvoid *) glNewList },
755 { "glNormal3b", (GLvoid *) glNormal3b },
756 { "glNormal3bv", (GLvoid *) glNormal3bv },
757 { "glNormal3d", (GLvoid *) glNormal3d },
758 { "glNormal3dv", (GLvoid *) glNormal3dv },
759 { "glNormal3f", (GLvoid *) glNormal3f },
760 { "glNormal3fv", (GLvoid *) glNormal3fv },
761 { "glNormal3i", (GLvoid *) glNormal3i },
762 { "glNormal3iv", (GLvoid *) glNormal3iv },
763 { "glNormal3s", (GLvoid *) glNormal3s },
764 { "glNormal3sv", (GLvoid *) glNormal3sv },
765 { "glOrtho", (GLvoid *) glOrtho },
766 { "glPassThrough", (GLvoid *) glPassThrough },
767 { "glPixelMapfv", (GLvoid *) glPixelMapfv },
768 { "glPixelMapuiv", (GLvoid *) glPixelMapuiv },
769 { "glPixelMapusv", (GLvoid *) glPixelMapusv },
770 { "glPixelStoref", (GLvoid *) glPixelStoref },
771 { "glPixelStorei", (GLvoid *) glPixelStorei },
772 { "glPixelTransferf", (GLvoid *) glPixelTransferf },
773 { "glPixelTransferi", (GLvoid *) glPixelTransferi },
774 { "glPixelZoom", (GLvoid *) glPixelZoom },
775 { "glPointSize", (GLvoid *) glPointSize },
776 { "glPolygonMode", (GLvoid *) glPolygonMode },
777 { "glPolygonOffset", (GLvoid *) glPolygonOffset },
778 { "glPolygonStipple", (GLvoid *) glPolygonStipple },
779 { "glPopAttrib", (GLvoid *) glPopAttrib },
780 { "glPopMatrix", (GLvoid *) glPopMatrix },
781 { "glPopName", (GLvoid *) glPopName },
782 { "glPushAttrib", (GLvoid *) glPushAttrib },
783 { "glPushMatrix", (GLvoid *) glPushMatrix },
784 { "glPushName", (GLvoid *) glPushName },
785 { "glRasterPos2d", (GLvoid *) glRasterPos2d },
786 { "glRasterPos2dv", (GLvoid *) glRasterPos2dv },
787 { "glRasterPos2f", (GLvoid *) glRasterPos2f },
788 { "glRasterPos2fv", (GLvoid *) glRasterPos2fv },
789 { "glRasterPos2i", (GLvoid *) glRasterPos2i },
790 { "glRasterPos2iv", (GLvoid *) glRasterPos2iv },
791 { "glRasterPos2s", (GLvoid *) glRasterPos2s },
792 { "glRasterPos2sv", (GLvoid *) glRasterPos2sv },
793 { "glRasterPos3d", (GLvoid *) glRasterPos3d },
794 { "glRasterPos3dv", (GLvoid *) glRasterPos3dv },
795 { "glRasterPos3f", (GLvoid *) glRasterPos3f },
796 { "glRasterPos3fv", (GLvoid *) glRasterPos3fv },
797 { "glRasterPos3i", (GLvoid *) glRasterPos3i },
798 { "glRasterPos3iv", (GLvoid *) glRasterPos3iv },
799 { "glRasterPos3s", (GLvoid *) glRasterPos3s },
800 { "glRasterPos3sv", (GLvoid *) glRasterPos3sv },
801 { "glRasterPos4d", (GLvoid *) glRasterPos4d },
802 { "glRasterPos4dv", (GLvoid *) glRasterPos4dv },
803 { "glRasterPos4f", (GLvoid *) glRasterPos4f },
804 { "glRasterPos4fv", (GLvoid *) glRasterPos4fv },
805 { "glRasterPos4i", (GLvoid *) glRasterPos4i },
806 { "glRasterPos4iv", (GLvoid *) glRasterPos4iv },
807 { "glRasterPos4s", (GLvoid *) glRasterPos4s },
808 { "glRasterPos4sv", (GLvoid *) glRasterPos4sv },
809 { "glReadBuffer", (GLvoid *) glReadBuffer },
810 { "glReadPixels", (GLvoid *) glReadPixels },
811 { "glRectd", (GLvoid *) glRectd },
812 { "glRectdv", (GLvoid *) glRectdv },
813 { "glRectf", (GLvoid *) glRectf },
814 { "glRectfv", (GLvoid *) glRectfv },
815 { "glRecti", (GLvoid *) glRecti },
816 { "glRectiv", (GLvoid *) glRectiv },
817 { "glRects", (GLvoid *) glRects },
818 { "glRectsv", (GLvoid *) glRectsv },
819 { "glRenderMode", (GLvoid *) glRenderMode },
820 { "glRotated", (GLvoid *) glRotated },
821 { "glRotatef", (GLvoid *) glRotatef },
822 { "glScaled", (GLvoid *) glScaled },
823 { "glScalef", (GLvoid *) glScalef },
824 { "glScissor", (GLvoid *) glScissor },
825 { "glSelectBuffer", (GLvoid *) glSelectBuffer },
826 { "glShadeModel", (GLvoid *) glShadeModel },
827 { "glStencilFunc", (GLvoid *) glStencilFunc },
828 { "glStencilMask", (GLvoid *) glStencilMask },
829 { "glStencilOp", (GLvoid *) glStencilOp },
830 { "glTexCoord1d", (GLvoid *) glTexCoord1d },
831 { "glTexCoord1dv", (GLvoid *) glTexCoord1dv },
832 { "glTexCoord1f", (GLvoid *) glTexCoord1f },
833 { "glTexCoord1fv", (GLvoid *) glTexCoord1fv },
834 { "glTexCoord1i", (GLvoid *) glTexCoord1i },
835 { "glTexCoord1iv", (GLvoid *) glTexCoord1iv },
836 { "glTexCoord1s", (GLvoid *) glTexCoord1s },
837 { "glTexCoord1sv", (GLvoid *) glTexCoord1sv },
838 { "glTexCoord2d", (GLvoid *) glTexCoord2d },
839 { "glTexCoord2dv", (GLvoid *) glTexCoord2dv },
840 { "glTexCoord2f", (GLvoid *) glTexCoord2f },
841 { "glTexCoord2fv", (GLvoid *) glTexCoord2fv },
842 { "glTexCoord2i", (GLvoid *) glTexCoord2i },
843 { "glTexCoord2iv", (GLvoid *) glTexCoord2iv },
844 { "glTexCoord2s", (GLvoid *) glTexCoord2s },
845 { "glTexCoord2sv", (GLvoid *) glTexCoord2sv },
846 { "glTexCoord3d", (GLvoid *) glTexCoord3d },
847 { "glTexCoord3dv", (GLvoid *) glTexCoord3dv },
848 { "glTexCoord3f", (GLvoid *) glTexCoord3f },
849 { "glTexCoord3fv", (GLvoid *) glTexCoord3fv },
850 { "glTexCoord3i", (GLvoid *) glTexCoord3i },
851 { "glTexCoord3iv", (GLvoid *) glTexCoord3iv },
852 { "glTexCoord3s", (GLvoid *) glTexCoord3s },
853 { "glTexCoord3sv", (GLvoid *) glTexCoord3sv },
854 { "glTexCoord4d", (GLvoid *) glTexCoord4d },
855 { "glTexCoord4dv", (GLvoid *) glTexCoord4dv },
856 { "glTexCoord4f", (GLvoid *) glTexCoord4f },
857 { "glTexCoord4fv", (GLvoid *) glTexCoord4fv },
858 { "glTexCoord4i", (GLvoid *) glTexCoord4i },
859 { "glTexCoord4iv", (GLvoid *) glTexCoord4iv },
860 { "glTexCoord4s", (GLvoid *) glTexCoord4s },
861 { "glTexCoord4sv", (GLvoid *) glTexCoord4sv },
862 { "glTexEnvf", (GLvoid *) glTexEnvf },
863 { "glTexEnvfv", (GLvoid *) glTexEnvfv },
864 { "glTexEnvi", (GLvoid *) glTexEnvi },
865 { "glTexEnviv", (GLvoid *) glTexEnviv },
866 { "glTexGend", (GLvoid *) glTexGend },
867 { "glTexGendv", (GLvoid *) glTexGendv },
868 { "glTexGenf", (GLvoid *) glTexGenf },
869 { "glTexGenfv", (GLvoid *) glTexGenfv },
870 { "glTexGeni", (GLvoid *) glTexGeni },
871 { "glTexGeniv", (GLvoid *) glTexGeniv },
872 { "glTexImage1D", (GLvoid *) glTexImage1D },
873 { "glTexImage2D", (GLvoid *) glTexImage2D },
874 { "glTexParameterf", (GLvoid *) glTexParameterf },
875 { "glTexParameterfv", (GLvoid *) glTexParameterfv },
876 { "glTexParameteri", (GLvoid *) glTexParameteri },
877 { "glTexParameteriv", (GLvoid *) glTexParameteriv },
878 { "glTranslated", (GLvoid *) glTranslated },
879 { "glTranslatef", (GLvoid *) glTranslatef },
880 { "glVertex2d", (GLvoid *) glVertex2d },
881 { "glVertex2dv", (GLvoid *) glVertex2dv },
882 { "glVertex2f", (GLvoid *) glVertex2f },
883 { "glVertex2fv", (GLvoid *) glVertex2fv },
884 { "glVertex2i", (GLvoid *) glVertex2i },
885 { "glVertex2iv", (GLvoid *) glVertex2iv },
886 { "glVertex2s", (GLvoid *) glVertex2s },
887 { "glVertex2sv", (GLvoid *) glVertex2sv },
888 { "glVertex3d", (GLvoid *) glVertex3d },
889 { "glVertex3dv", (GLvoid *) glVertex3dv },
890 { "glVertex3f", (GLvoid *) glVertex3f },
891 { "glVertex3fv", (GLvoid *) glVertex3fv },
892 { "glVertex3i", (GLvoid *) glVertex3i },
893 { "glVertex3iv", (GLvoid *) glVertex3iv },
894 { "glVertex3s", (GLvoid *) glVertex3s },
895 { "glVertex3sv", (GLvoid *) glVertex3sv },
896 { "glVertex4d", (GLvoid *) glVertex4d },
897 { "glVertex4dv", (GLvoid *) glVertex4dv },
898 { "glVertex4f", (GLvoid *) glVertex4f },
899 { "glVertex4fv", (GLvoid *) glVertex4fv },
900 { "glVertex4i", (GLvoid *) glVertex4i },
901 { "glVertex4iv", (GLvoid *) glVertex4iv },
902 { "glVertex4s", (GLvoid *) glVertex4s },
903 { "glVertex4sv", (GLvoid *) glVertex4sv },
904 { "glViewport", (GLvoid *) glViewport },
905
906 /* GL 1.1 */
907 #ifdef GL_VERSION_1_1
908 #define NAME(X) X
909 #else
910 #define NAME(X) NotImplemented
911 #endif
912 { "glAreTexturesResident", (GLvoid *) NAME(glAreTexturesResident) },
913 { "glArrayElement", (GLvoid *) NAME(glArrayElement) },
914 { "glBindTexture", (GLvoid *) NAME(glBindTexture) },
915 { "glColorPointer", (GLvoid *) NAME(glColorPointer) },
916 { "glCopyTexImage1D", (GLvoid *) NAME(glCopyTexImage1D) },
917 { "glCopyTexImage2D", (GLvoid *) NAME(glCopyTexImage2D) },
918 { "glCopyTexSubImage1D", (GLvoid *) NAME(glCopyTexSubImage1D) },
919 { "glCopyTexSubImage2D", (GLvoid *) NAME(glCopyTexSubImage2D) },
920 { "glDeleteTextures", (GLvoid *) NAME(glDeleteTextures) },
921 { "glDisableClientState", (GLvoid *) NAME(glDisableClientState) },
922 { "glDrawArrays", (GLvoid *) NAME(glDrawArrays) },
923 { "glDrawElements", (GLvoid *) NAME(glDrawElements) },
924 { "glEdgeFlagPointer", (GLvoid *) NAME(glEdgeFlagPointer) },
925 { "glEnableClientState", (GLvoid *) NAME(glEnableClientState) },
926 { "glGenTextures", (GLvoid *) NAME(glGenTextures) },
927 { "glGetPointerv", (GLvoid *) NAME(glGetPointerv) },
928 { "glIndexPointer", (GLvoid *) NAME(glIndexPointer) },
929 { "glIndexub", (GLvoid *) NAME(glIndexub) },
930 { "glIndexubv", (GLvoid *) NAME(glIndexubv) },
931 { "glInterleavedArrays", (GLvoid *) NAME(glInterleavedArrays) },
932 { "glIsTexture", (GLvoid *) NAME(glIsTexture) },
933 { "glNormalPointer", (GLvoid *) NAME(glNormalPointer) },
934 { "glPopClientAttrib", (GLvoid *) NAME(glPopClientAttrib) },
935 { "glPrioritizeTextures", (GLvoid *) NAME(glPrioritizeTextures) },
936 { "glPushClientAttrib", (GLvoid *) NAME(glPushClientAttrib) },
937 { "glTexCoordPointer", (GLvoid *) NAME(glTexCoordPointer) },
938 { "glTexSubImage1D", (GLvoid *) NAME(glTexSubImage1D) },
939 { "glTexSubImage2D", (GLvoid *) NAME(glTexSubImage2D) },
940 { "glVertexPointer", (GLvoid *) NAME(glVertexPointer) },
941 #undef NAME
942
943 /* GL 1.2 */
944 #ifdef GL_VERSION_1_2
945 #define NAME(X) X
946 #else
947 #define NAME(X) NotImplemented
948 #endif
949 { "glCopyTexSubImage3D", (GLvoid *) NAME(glCopyTexSubImage3D) },
950 { "glDrawRangeElements", (GLvoid *) NAME(glDrawRangeElements) },
951 { "glTexImage3D", (GLvoid *) NAME(glTexImage3D) },
952 { "glTexSubImage3D", (GLvoid *) NAME(glTexSubImage3D) },
953 #undef NAME
954
955 /* GL_ARB_imaging */
956 #ifdef GL_ARB_imaging
957 #define NAME(X) X
958 #else
959 #define NAME(X) NotImplemented
960 #endif
961 { "glBlendColor", (GLvoid *) NAME(glBlendColor) },
962 { "glBlendEquation", (GLvoid *) NAME(glBlendEquation) },
963 { "glColorSubTable", (GLvoid *) NAME(glColorSubTable) },
964 { "glColorTable", (GLvoid *) NAME(glColorTable) },
965 { "glColorTableParameterfv", (GLvoid *) NAME(glColorTableParameterfv) },
966 { "glColorTableParameteriv", (GLvoid *) NAME(glColorTableParameteriv) },
967 { "glConvolutionFilter1D", (GLvoid *) NAME(glConvolutionFilter1D) },
968 { "glConvolutionFilter2D", (GLvoid *) NAME(glConvolutionFilter2D) },
969 { "glConvolutionParameterf", (GLvoid *) NAME(glConvolutionParameterf) },
970 { "glConvolutionParameterfv", (GLvoid *) NAME(glConvolutionParameterfv) },
971 { "glConvolutionParameteri", (GLvoid *) NAME(glConvolutionParameteri) },
972 { "glConvolutionParameteriv", (GLvoid *) NAME(glConvolutionParameteriv) },
973 { "glCopyColorSubTable", (GLvoid *) NAME(glCopyColorSubTable) },
974 { "glCopyColorTable", (GLvoid *) NAME(glCopyColorTable) },
975 { "glCopyConvolutionFilter1D", (GLvoid *) NAME(glCopyConvolutionFilter1D) },
976 { "glCopyConvolutionFilter2D", (GLvoid *) NAME(glCopyConvolutionFilter2D) },
977 { "glGetColorTable", (GLvoid *) NAME(glGetColorTable) },
978 { "glGetColorTableParameterfv", (GLvoid *) NAME(glGetColorTableParameterfv) },
979 { "glGetColorTableParameteriv", (GLvoid *) NAME(glGetColorTableParameteriv) },
980 { "glGetConvolutionFilter", (GLvoid *) NAME(glGetConvolutionFilter) },
981 { "glGetConvolutionParameterfv", (GLvoid *) NAME(glGetConvolutionParameterfv) },
982 { "glGetConvolutionParameteriv", (GLvoid *) NAME(glGetConvolutionParameteriv) },
983 { "glGetHistogram", (GLvoid *) NAME(glGetHistogram) },
984 { "glGetHistogramParameterfv", (GLvoid *) NAME(glGetHistogramParameterfv) },
985 { "glGetHistogramParameteriv", (GLvoid *) NAME(glGetHistogramParameteriv) },
986 { "glGetMinmax", (GLvoid *) NAME(glGetMinmax) },
987 { "glGetMinmaxParameterfv", (GLvoid *) NAME(glGetMinmaxParameterfv) },
988 { "glGetMinmaxParameteriv", (GLvoid *) NAME(glGetMinmaxParameteriv) },
989 { "glGetSeparableFilter", (GLvoid *) NAME(glGetSeparableFilter) },
990 { "glHistogram", (GLvoid *) NAME(glHistogram) },
991 { "glMinmax", (GLvoid *) NAME(glMinmax) },
992 { "glResetHistogram", (GLvoid *) NAME(glResetHistogram) },
993 { "glResetMinmax", (GLvoid *) NAME(glResetMinmax) },
994 { "glSeparableFilter2D", (GLvoid *) NAME(glSeparableFilter2D) },
995 #undef NAME
996
997 /* GL_ARB_multitexture */
998 #ifdef GL_ARB_multitexture
999 #define NAME(X) X
1000 #else
1001 #define NAME(X) NotImplemented
1002 #endif
1003 { "glActiveTextureARB", (GLvoid *) NAME(glActiveTextureARB) },
1004 { "glClientActiveTextureARB", (GLvoid *) NAME(glClientActiveTextureARB) },
1005 { "glMultiTexCoord1dARB", (GLvoid *) NAME(glMultiTexCoord1dARB) },
1006 { "glMultiTexCoord1dvARB", (GLvoid *) NAME(glMultiTexCoord1dvARB) },
1007 { "glMultiTexCoord1fARB", (GLvoid *) NAME(glMultiTexCoord1fARB) },
1008 { "glMultiTexCoord1fvARB", (GLvoid *) NAME(glMultiTexCoord1fvARB) },
1009 { "glMultiTexCoord1iARB", (GLvoid *) NAME(glMultiTexCoord1iARB) },
1010 { "glMultiTexCoord1ivARB", (GLvoid *) NAME(glMultiTexCoord1ivARB) },
1011 { "glMultiTexCoord1sARB", (GLvoid *) NAME(glMultiTexCoord1sARB) },
1012 { "glMultiTexCoord1svARB", (GLvoid *) NAME(glMultiTexCoord1svARB) },
1013 { "glMultiTexCoord2dARB", (GLvoid *) NAME(glMultiTexCoord2dARB) },
1014 { "glMultiTexCoord2dvARB", (GLvoid *) NAME(glMultiTexCoord2dvARB) },
1015 { "glMultiTexCoord2fARB", (GLvoid *) NAME(glMultiTexCoord2fARB) },
1016 { "glMultiTexCoord2fvARB", (GLvoid *) NAME(glMultiTexCoord2fvARB) },
1017 { "glMultiTexCoord2iARB", (GLvoid *) NAME(glMultiTexCoord2iARB) },
1018 { "glMultiTexCoord2ivARB", (GLvoid *) NAME(glMultiTexCoord2ivARB) },
1019 { "glMultiTexCoord2sARB", (GLvoid *) NAME(glMultiTexCoord2sARB) },
1020 { "glMultiTexCoord2svARB", (GLvoid *) NAME(glMultiTexCoord2svARB) },
1021 { "glMultiTexCoord3dARB", (GLvoid *) NAME(glMultiTexCoord3dARB) },
1022 { "glMultiTexCoord3dvARB", (GLvoid *) NAME(glMultiTexCoord3dvARB) },
1023 { "glMultiTexCoord3fARB", (GLvoid *) NAME(glMultiTexCoord3fARB) },
1024 { "glMultiTexCoord3fvARB", (GLvoid *) NAME(glMultiTexCoord3fvARB) },
1025 { "glMultiTexCoord3iARB", (GLvoid *) NAME(glMultiTexCoord3iARB) },
1026 { "glMultiTexCoord3ivARB", (GLvoid *) NAME(glMultiTexCoord3ivARB) },
1027 { "glMultiTexCoord3sARB", (GLvoid *) NAME(glMultiTexCoord3sARB) },
1028 { "glMultiTexCoord3svARB", (GLvoid *) NAME(glMultiTexCoord3svARB) },
1029 { "glMultiTexCoord4dARB", (GLvoid *) NAME(glMultiTexCoord4dARB) },
1030 { "glMultiTexCoord4dvARB", (GLvoid *) NAME(glMultiTexCoord4dvARB) },
1031 { "glMultiTexCoord4fARB", (GLvoid *) NAME(glMultiTexCoord4fARB) },
1032 { "glMultiTexCoord4fvARB", (GLvoid *) NAME(glMultiTexCoord4fvARB) },
1033 { "glMultiTexCoord4iARB", (GLvoid *) NAME(glMultiTexCoord4iARB) },
1034 { "glMultiTexCoord4ivARB", (GLvoid *) NAME(glMultiTexCoord4ivARB) },
1035 { "glMultiTexCoord4sARB", (GLvoid *) NAME(glMultiTexCoord4sARB) },
1036 { "glMultiTexCoord4svARB", (GLvoid *) NAME(glMultiTexCoord4svARB) },
1037 #undef NAME
1038
1039 /* 2. GL_EXT_blend_color */
1040 #ifdef GL_EXT_blend_color
1041 #define NAME(X) X
1042 #else
1043 #define NAME(X) NotImplemented
1044 #endif
1045 { "glBlendColorEXT", (GLvoid *) NAME(glBlendColorEXT) },
1046 #undef NAME
1047
1048 /* 3. GL_EXT_polygon_offset */
1049 #ifdef GL_EXT_polygon_offset
1050 #define NAME(X) X
1051 #else
1052 #define NAME(X) NotImplemented
1053 #endif
1054 { "glPolygonOffsetEXT", (GLvoid *) NAME(glPolygonOffsetEXT) },
1055 #undef NAME
1056
1057 /* 6. GL_EXT_texture3D */
1058 #ifdef GL_EXT_texture3D
1059 #define NAME(X) X
1060 #else
1061 #define NAME(X) NotImplemented
1062 #endif
1063 { "glCopyTexSubImage3DEXT", (GLvoid *) NAME(glCopyTexSubImage3DEXT) },
1064 { "glTexImage3DEXT", (GLvoid *) NAME(glTexImage3DEXT) },
1065 { "glTexSubImage3DEXT", (GLvoid *) NAME(glTexSubImage3DEXT) },
1066 #undef NAME
1067
1068 /* 7. GL_SGI_texture_filter4 */
1069 #ifdef GL_SGI_texture_filter4
1070 #define NAME(X) X
1071 #else
1072 #define NAME(X) NotImplemented
1073 #endif
1074 { "glGetTexFilterFuncSGIS", (GLvoid *) NAME(glGetTexFilterFuncSGIS) },
1075 { "glTexFilterFuncSGIS", (GLvoid *) NAME(glTexFilterFuncSGIS) },
1076 #undef NAME
1077
1078 /* 9. GL_EXT_subtexture */
1079 #ifdef GL_EXT_subtexture
1080 #define NAME(X) X
1081 #else
1082 #define NAME(X) NotImplemented
1083 #endif
1084 { "glTexSubImage1DEXT", (GLvoid *) NAME(glTexSubImage1DEXT) },
1085 { "glTexSubImage2DEXT", (GLvoid *) NAME(glTexSubImage2DEXT) },
1086 #undef NAME
1087
1088 /* 10. GL_EXT_copy_texture */
1089 #ifdef GL_EXT_copy_texture
1090 #define NAME(X) X
1091 #else
1092 #define NAME(X) NotImplemented
1093 #endif
1094 { "glCopyTexImage1DEXT", (GLvoid *) NAME(glCopyTexImage1DEXT) },
1095 { "glCopyTexImage2DEXT", (GLvoid *) NAME(glCopyTexImage2DEXT) },
1096 { "glCopyTexSubImage1DEXT", (GLvoid *) NAME(glCopyTexSubImage1DEXT) },
1097 { "glCopyTexSubImage2DEXT", (GLvoid *) NAME(glCopyTexSubImage2DEXT) },
1098 #undef NAME
1099
1100 /* 11. GL_EXT_histogram */
1101 #ifdef GL_EXT_histogram
1102 #define NAME(X) X
1103 #else
1104 #define NAME(X) NotImplemented
1105 #endif
1106 { "glGetHistogramEXT", (GLvoid *) NAME(glGetHistogramEXT) },
1107 { "glGetHistogramParameterfvEXT", (GLvoid *) NAME(glGetHistogramParameterfvEXT) },
1108 { "glGetHistogramParameterivEXT", (GLvoid *) NAME(glGetHistogramParameterivEXT) },
1109 { "glGetMinmaxEXT", (GLvoid *) NAME(glGetMinmaxEXT) },
1110 { "glGetMinmaxParameterfvEXT", (GLvoid *) NAME(glGetMinmaxParameterfvEXT) },
1111 { "glGetMinmaxParameterivEXT", (GLvoid *) NAME(glGetMinmaxParameterivEXT) },
1112 { "glHistogramEXT", (GLvoid *) NAME(glHistogramEXT) },
1113 { "glMinmaxEXT", (GLvoid *) NAME(glMinmaxEXT) },
1114 { "glResetHistogramEXT", (GLvoid *) NAME(glResetHistogramEXT) },
1115 { "glResetMinmaxEXT", (GLvoid *) NAME(glResetMinmaxEXT) },
1116 #undef NAME
1117
1118 /* 12. GL_EXT_convolution */
1119 #ifdef GL_EXT_convolution
1120 #define NAME(X) X
1121 #else
1122 #define NAME(X) NotImplemented
1123 #endif
1124 { "glConvolutionFilter1DEXT", (GLvoid *) NAME(glConvolutionFilter1DEXT) },
1125 { "glConvolutionFilter2DEXT", (GLvoid *) NAME(glConvolutionFilter2DEXT) },
1126 { "glConvolutionParameterfEXT", (GLvoid *) NAME(glConvolutionParameterfEXT) },
1127 { "glConvolutionParameterfvEXT", (GLvoid *) NAME(glConvolutionParameterfvEXT) },
1128 { "glConvolutionParameteriEXT", (GLvoid *) NAME(glConvolutionParameteriEXT) },
1129 { "glConvolutionParameterivEXT", (GLvoid *) NAME(glConvolutionParameterivEXT) },
1130 { "glCopyConvolutionFilter1DEXT", (GLvoid *) NAME(glCopyConvolutionFilter1DEXT) },
1131 { "glCopyConvolutionFilter2DEXT", (GLvoid *) NAME(glCopyConvolutionFilter2DEXT) },
1132 { "glGetConvolutionFilterEXT", (GLvoid *) NAME(glGetConvolutionFilterEXT) },
1133 { "glGetConvolutionParameterivEXT", (GLvoid *) NAME(glGetConvolutionParameterivEXT) },
1134 { "glGetConvolutionParameterfvEXT", (GLvoid *) NAME(glGetConvolutionParameterfvEXT) },
1135 { "glGetSeparableFilterEXT", (GLvoid *) NAME(glGetSeparableFilterEXT) },
1136 { "glSeparableFilter2DEXT", (GLvoid *) NAME(glSeparableFilter2DEXT) },
1137 #undef NAME
1138
1139 /* 14. GL_SGI_color_table */
1140 #ifdef GL_SGI_color_table
1141 #define NAME(X) X
1142 #else
1143 #define NAME(X) NotImplemented
1144 #endif
1145 { "glColorTableSGI", (GLvoid *) NAME(glColorTableSGI) },
1146 { "glColorTableParameterfvSGI", (GLvoid *) NAME(glColorTableParameterfvSGI) },
1147 { "glColorTableParameterivSGI", (GLvoid *) NAME(glColorTableParameterivSGI) },
1148 { "glCopyColorTableSGI", (GLvoid *) NAME(glCopyColorTableSGI) },
1149 { "glGetColorTableSGI", (GLvoid *) NAME(glGetColorTableSGI) },
1150 { "glGetColorTableParameterfvSGI", (GLvoid *) NAME(glGetColorTableParameterfvSGI) },
1151 { "glGetColorTableParameterivSGI", (GLvoid *) NAME(glGetColorTableParameterivSGI) },
1152 #undef NAME
1153
1154 /* 15. GL_SGIS_pixel_texture */
1155 #ifdef GL_SGIS_pixel_texture
1156 #define NAME(X) X
1157 #else
1158 #define NAME(X) NotImplemented
1159 #endif
1160 { "glPixelTexGenParameterfSGIS", (GLvoid *) NAME(glPixelTexGenParameterfSGIS) },
1161 { "glPixelTexGenParameteriSGIS", (GLvoid *) NAME(glPixelTexGenParameteriSGIS) },
1162 { "glGetPixelTexGenParameterfvSGIS", (GLvoid *) NAME(glGetPixelTexGenParameterfvSGIS) },
1163 { "glGetPixelTexGenParameterivSGIS", (GLvoid *) NAME(glGetPixelTexGenParameterivSGIS) },
1164 #undef NAME
1165
1166 /* 16. GL_SGIS_texture4D */
1167 #ifdef GL_SGIS_texture4D
1168 #define NAME(X) X
1169 #else
1170 #define NAME(X) NotImplemented
1171 #endif
1172 { "glTexImage4DSGIS", (GLvoid *) NAME(glTexImage4DSGIS) },
1173 { "glTexSubImage4DSGIS", (GLvoid *) NAME(glTexSubImage4DSGIS) },
1174 #undef NAME
1175
1176 /* 20. GL_EXT_texture_object */
1177 #ifdef GL_EXT_texture_object
1178 #define NAME(X) X
1179 #else
1180 #define NAME(X) NotImplemented
1181 #endif
1182 { "glAreTexturesResidentEXT", (GLvoid *) NAME(glAreTexturesResidentEXT) },
1183 { "glBindTextureEXT", (GLvoid *) NAME(glBindTextureEXT) },
1184 { "glDeleteTexturesEXT", (GLvoid *) NAME(glDeleteTexturesEXT) },
1185 { "glGenTexturesEXT", (GLvoid *) NAME(glGenTexturesEXT) },
1186 { "glIsTextureEXT", (GLvoid *) NAME(glIsTextureEXT) },
1187 { "glPrioritizeTexturesEXT", (GLvoid *) NAME(glPrioritizeTexturesEXT) },
1188 #undef NAME
1189
1190 /* 21. GL_SGIS_detail_texture */
1191 #ifdef GL_SGIS_detail_texture
1192 #define NAME(X) X
1193 #else
1194 #define NAME(X) NotImplemented
1195 #endif
1196 { "glDetailTexFuncSGIS", (GLvoid *) NAME(glDetailTexFuncSGIS) },
1197 { "glGetDetailTexFuncSGIS", (GLvoid *) NAME(glGetDetailTexFuncSGIS) },
1198 #undef NAME
1199
1200 /* 22. GL_SGIS_sharpen_texture */
1201 #ifdef GL_SGIS_sharpen_texture
1202 #define NAME(X) X
1203 #else
1204 #define NAME(X) NotImplemented
1205 #endif
1206 { "glGetSharpenTexFuncSGIS", (GLvoid *) NAME(glGetSharpenTexFuncSGIS) },
1207 { "glSharpenTexFuncSGIS", (GLvoid *) NAME(glSharpenTexFuncSGIS) },
1208 #undef NAME
1209
1210 /* 25. GL_SGIS_multisample */
1211 #ifdef GL_SGIS_multisample
1212 #define NAME(X) X
1213 #else
1214 #define NAME(X) NotImplemented
1215 #endif
1216 { "glSampleMaskSGIS", (GLvoid *) NAME(glSampleMaskSGIS) },
1217 { "glSamplePatternSGIS", (GLvoid *) NAME(glSamplePatternSGIS) },
1218 #undef NAME
1219
1220 /* 30. GL_EXT_vertex_array */
1221 #ifdef GL_EXT_vertex_array
1222 #define NAME(X) X
1223 #else
1224 #define NAME(X) NotImplemented
1225 #endif
1226 { "glArrayElementEXT", (GLvoid *) NAME(glArrayElementEXT) },
1227 { "glColorPointerEXT", (GLvoid *) NAME(glColorPointerEXT) },
1228 { "glDrawArraysEXT", (GLvoid *) NAME(glDrawArraysEXT) },
1229 { "glEdgeFlagPointerEXT", (GLvoid *) NAME(glEdgeFlagPointerEXT) },
1230 { "glGetPointervEXT", (GLvoid *) NAME(glGetPointervEXT) },
1231 { "glIndexPointerEXT", (GLvoid *) NAME(glIndexPointerEXT) },
1232 { "glNormalPointerEXT", (GLvoid *) NAME(glNormalPointerEXT) },
1233 { "glTexCoordPointerEXT", (GLvoid *) NAME(glTexCoordPointerEXT) },
1234 { "glVertexPointerEXT", (GLvoid *) NAME(glVertexPointerEXT) },
1235 #undef NAME
1236
1237 /* 37. GL_EXT_blend_minmax */
1238 #ifdef GL_EXT_blend_minmax
1239 #define NAME(X) X
1240 #else
1241 #define NAME(X) NotImplemented
1242 #endif
1243 { "glBlendEquationEXT", (GLvoid *) NAME(glBlendEquationEXT) },
1244 #undef NAME
1245
1246 /* 52. GL_SGIX_sprite */
1247 #ifdef GL_SGIX_sprite
1248 #define NAME(X) X
1249 #else
1250 #define NAME(X) NotImplemented
1251 #endif
1252 { "glSpriteParameterfSGIX", (GLvoid *) NAME(glSpriteParameterfSGIX) },
1253 { "glSpriteParameterfvSGIX", (GLvoid *) NAME(glSpriteParameterfvSGIX) },
1254 { "glSpriteParameteriSGIX", (GLvoid *) NAME(glSpriteParameteriSGIX) },
1255 { "glSpriteParameterivSGIX", (GLvoid *) NAME(glSpriteParameterivSGIX) },
1256 #undef NAME
1257
1258 /* 54. GL_EXT_point_parameters */
1259 #ifdef GL_EXT_point_parameters
1260 #define NAME(X) X
1261 #else
1262 #define NAME(X) NotImplemented
1263 #endif
1264 { "glPointParameterfEXT", (GLvoid *) NAME(glPointParameterfEXT) },
1265 { "glPointParameterfvEXT", (GLvoid *) NAME(glPointParameterfvEXT) },
1266 #undef NAME
1267
1268 /* 55. GL_SGIX_instruments */
1269 #ifdef GL_SGIX_instruments
1270 #define NAME(X) X
1271 #else
1272 #define NAME(X) NotImplemented
1273 #endif
1274 { "glInstrumentsBufferSGIX", (GLvoid *) NAME(glInstrumentsBufferSGIX) },
1275 { "glStartInstrumentsSGIX", (GLvoid *) NAME(glStartInstrumentsSGIX) },
1276 { "glStopInstrumentsSGIX", (GLvoid *) NAME(glStopInstrumentsSGIX) },
1277 { "glReadInstrumentsSGIX", (GLvoid *) NAME(glReadInstrumentsSGIX) },
1278 { "glPollInstrumentsSGIX", (GLvoid *) NAME(glPollInstrumentsSGIX) },
1279 { "glGetInstrumentsSGIX", (GLvoid *) NAME(glGetInstrumentsSGIX) },
1280 #undef NAME
1281
1282 /* 57. GL_SGIX_framezoom */
1283 #ifdef GL_SGIX_framezoom
1284 #define NAME(X) X
1285 #else
1286 #define NAME(X) NotImplemented
1287 #endif
1288 { "glFrameZoomSGIX", (GLvoid *) NAME(glFrameZoomSGIX) },
1289 #undef NAME
1290
1291 /* 60. GL_SGIX_reference_plane */
1292 #ifdef GL_SGIX_reference_plane
1293 #define NAME(X) X
1294 #else
1295 #define NAME(X) NotImplemented
1296 #endif
1297 { "glReferencePlaneSGIX", (GLvoid *) NAME(glReferencePlaneSGIX) },
1298 #undef NAME
1299
1300 /* 61. GL_SGIX_flush_raster */
1301 #ifdef GL_SGIX_flush_raster
1302 #define NAME(X) X
1303 #else
1304 #define NAME(X) NotImplemented
1305 #endif
1306 { "glFlushRasterSGIX", (GLvoid *) NAME(glFlushRasterSGIX) },
1307 #undef NAME
1308
1309 /* 66. GL_HP_image_transform */
1310 #ifdef GL_HP_image_transform
1311 #define NAME(X) X
1312 #else
1313 #define NAME(X) NotImplemented
1314 #endif
1315 { "glGetImageTransformParameterfvHP", (GLvoid *) NAME(glGetImageTransformParameterfvHP) },
1316 { "glGetImageTransformParameterivHP", (GLvoid *) NAME(glGetImageTransformParameterivHP) },
1317 { "glImageTransformParameterfHP", (GLvoid *) NAME(glImageTransformParameterfHP) },
1318 { "glImageTransformParameterfvHP", (GLvoid *) NAME(glImageTransformParameterfvHP) },
1319 { "glImageTransformParameteriHP", (GLvoid *) NAME(glImageTransformParameteriHP) },
1320 { "glImageTransformParameterivHP", (GLvoid *) NAME(glImageTransformParameterivHP) },
1321 #undef NAME
1322
1323 /* 74. GL_EXT_color_subtable */
1324 #ifdef GL_EXT_color_subtable
1325 #define NAME(X) X
1326 #else
1327 #define NAME(X) NotImplemented
1328 #endif
1329 { "glColorSubTableEXT", (GLvoid *) NAME(glColorSubTableEXT) },
1330 { "glCopyColorSubTableEXT", (GLvoid *) NAME(glCopyColorSubTableEXT) },
1331 #undef NAME
1332
1333 /* 77. GL_PGI_misc_hints */
1334 #ifdef GL_PGI_misc_hints
1335 #define NAME(X) X
1336 #else
1337 #define NAME(X) NotImplemented
1338 #endif
1339 { "glHintPGI", (GLvoid *) NAME(glHintPGI) },
1340 #undef NAME
1341
1342 /* 78. GL_EXT_paletted_texture */
1343 #ifdef GL_EXT_paletted_texture
1344 #define NAME(X) X
1345 #else
1346 #define NAME(X) NotImplemented
1347 #endif
1348 { "glColorTableEXT", (GLvoid *) NAME(glColorTableEXT) },
1349 { "glGetColorTableEXT", (GLvoid *) NAME(glGetColorTableEXT) },
1350 { "glGetColorTableParameterfvEXT", (GLvoid *) NAME(glGetColorTableParameterfvEXT) },
1351 { "glGetColorTableParameterivEXT", (GLvoid *) NAME(glGetColorTableParameterivEXT) },
1352 #undef NAME
1353
1354 /* 80. GL_SGIX_list_priority */
1355 #ifdef GL_SGIX_list_priority
1356 #define NAME(X) X
1357 #else
1358 #define NAME(X) NotImplemented
1359 #endif
1360 { "glGetListParameterfvSGIX", (GLvoid *) NAME(glGetListParameterfvSGIX) },
1361 { "glGetListParameterivSGIX", (GLvoid *) NAME(glGetListParameterivSGIX) },
1362 { "glListParameterfSGIX", (GLvoid *) NAME(glListParameterfSGIX) },
1363 { "glListParameterfvSGIX", (GLvoid *) NAME(glListParameterfvSGIX) },
1364 { "glListParameteriSGIX", (GLvoid *) NAME(glListParameteriSGIX) },
1365 { "glListParameterivSGIX", (GLvoid *) NAME(glListParameterivSGIX) },
1366 #undef NAME
1367
1368 /* 94. GL_EXT_index_material */
1369 #ifdef GL_EXT_index_material
1370 #define NAME(X) X
1371 #else
1372 #define NAME(X) NotImplemented
1373 #endif
1374 { "glIndexMaterialEXT", (GLvoid *) NAME(glIndexMaterialEXT) },
1375 #undef NAME
1376
1377 /* 95. GL_EXT_index_func */
1378 #ifdef GL_EXT_index_func
1379 #define NAME(X) X
1380 #else
1381 #define NAME(X) NotImplemented
1382 #endif
1383 { "glIndexFuncEXT", (GLvoid *) NAME(glIndexFuncEXT) },
1384 #undef NAME
1385
1386 /* 97. GL_EXT_compiled_vertex_array */
1387 #ifdef GL_EXT_compiled_vertex_array
1388 #define NAME(X) X
1389 #else
1390 #define NAME(X) NotImplemented
1391 #endif
1392 { "glLockArraysEXT", (GLvoid *) NAME(glLockArraysEXT) },
1393 { "glUnlockArraysEXT", (GLvoid *) NAME(glUnlockArraysEXT) },
1394 #undef NAME
1395
1396 /* 98. GL_EXT_cull_vertex */
1397 #ifdef GL_EXT_cull_vertex
1398 #define NAME(X) X
1399 #else
1400 #define NAME(X) NotImplemented
1401 #endif
1402 { "glCullParameterfvEXT", (GLvoid *) NAME(glCullParameterfvEXT) },
1403 { "glCullParameterdvEXT", (GLvoid *) NAME(glCullParameterdvEXT) },
1404 #undef NAME
1405
1406 /* 173. GL_EXT/INGR_blend_func_separate */
1407 #ifdef GL_INGR_blend_func_separate
1408 #define NAME(X) X
1409 #else
1410 #define NAME(X) NotImplemented
1411 #endif
1412 { "glBlendFuncSeparateINGR", (GLvoid *) NAME(glBlendFuncSeparateINGR) },
1413 #undef NAME
1414
1415 /* GL_MESA_window_pos */
1416 #ifdef MESA_window_pos
1417 #define NAME(X) X
1418 #else
1419 #define NAME(X) NotImplemented
1420 #endif
1421 { "glWindowPos4fMESA", (GLvoid *) NAME(glWindowPos4fMESA) },
1422 #undef NAME
1423
1424 /* GL_MESA_resize_buffers */
1425 #ifdef MESA_resize_buffers
1426 #define NAME(X) X
1427 #else
1428 #define NAME(X) NotImplemented
1429 #endif
1430 { "glResizeBuffersMESA", (GLvoid *) NAME(glResizeBuffersMESA) },
1431 #undef NAME
1432
1433 /* GL_ARB_transpose_matrix */
1434 #ifdef GL_ARB_transpose_matrix
1435 #define NAME(X) X
1436 #else
1437 #define NAME(X) NotImplemented
1438 #endif
1439 { "glLoadTransposeMatrixdARB", (GLvoid *) NAME(glLoadTransposeMatrixdARB) },
1440 { "glLoadTransposeMatrixfARB", (GLvoid *) NAME(glLoadTransposeMatrixfARB) },
1441 { "glMultTransposeMatrixdARB", (GLvoid *) NAME(glMultTransposeMatrixdARB) },
1442 { "glMultTransposeMatrixfARB", (GLvoid *) NAME(glMultTransposeMatrixfARB) },
1443 #undef NAME
1444
1445 /*
1446 * XXX many more extenstion functions to add.
1447 */
1448
1449 { NULL, NULL } /* end of list marker */
1450 };
1451