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