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