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