4 * Functions related to OpenGL extensions.
6 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
7 * Written by Pawel W. Olszta, <olszta@sourceforge.net>
8 * Creation date: Thu Dec 9 1999
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 #define GLX_GLXEXT_PROTOTYPES
34 #include "../include/GL/freeglut.h"
35 #include "freeglut_internal.h"
38 struct name_address_pair
44 static struct name_address_pair glut_functions[] =
46 { "glutInit", (void *) glutInit },
47 { "glutInitDisplayMode", (void *) glutInitDisplayMode },
48 { "glutInitDisplayString", (void *) glutInitDisplayString },
49 { "glutInitWindowPosition", (void *) glutInitWindowPosition },
50 { "glutInitWindowSize", (void *) glutInitWindowSize },
51 { "glutMainLoop", (void *) glutMainLoop },
52 { "glutCreateWindow", (void *) glutCreateWindow },
53 { "glutCreateSubWindow", (void *) glutCreateSubWindow },
54 { "glutDestroyWindow", (void *) glutDestroyWindow },
55 { "glutPostRedisplay", (void *) glutPostRedisplay },
56 { "glutPostWindowRedisplay", (void *) glutPostWindowRedisplay },
57 { "glutSwapBuffers", (void *) glutSwapBuffers },
58 { "glutGetWindow", (void *) glutGetWindow },
59 { "glutSetWindow", (void *) glutSetWindow },
60 { "glutSetWindowTitle", (void *) glutSetWindowTitle },
61 { "glutSetIconTitle", (void *) glutSetIconTitle },
62 { "glutPositionWindow", (void *) glutPositionWindow },
63 { "glutReshapeWindow", (void *) glutReshapeWindow },
64 { "glutPopWindow", (void *) glutPopWindow },
65 { "glutPushWindow", (void *) glutPushWindow },
66 { "glutIconifyWindow", (void *) glutIconifyWindow },
67 { "glutShowWindow", (void *) glutShowWindow },
68 { "glutHideWindow", (void *) glutHideWindow },
69 { "glutFullScreen", (void *) glutFullScreen },
70 { "glutSetCursor", (void *) glutSetCursor },
71 { "glutWarpPointer", (void *) glutWarpPointer },
72 { "glutEstablishOverlay", (void *) glutEstablishOverlay },
73 { "glutRemoveOverlay", (void *) glutRemoveOverlay },
74 { "glutUseLayer", (void *) glutUseLayer },
75 { "glutPostOverlayRedisplay", (void *) glutPostOverlayRedisplay },
76 { "glutPostWindowOverlayRedisplay", (void *) glutPostWindowOverlayRedisplay },
77 { "glutShowOverlay", (void *) glutShowOverlay },
78 { "glutHideOverlay", (void *) glutHideOverlay },
79 { "glutCreateMenu", (void *) glutCreateMenu },
80 { "glutDestroyMenu", (void *) glutDestroyMenu },
81 { "glutGetMenu", (void *) glutGetMenu },
82 { "glutSetMenu", (void *) glutSetMenu },
83 { "glutAddMenuEntry", (void *) glutAddMenuEntry },
84 { "glutAddSubMenu", (void *) glutAddSubMenu },
85 { "glutChangeToMenuEntry", (void *) glutChangeToMenuEntry },
86 { "glutChangeToSubMenu", (void *) glutChangeToSubMenu },
87 { "glutRemoveMenuItem", (void *) glutRemoveMenuItem },
88 { "glutAttachMenu", (void *) glutAttachMenu },
89 { "glutDetachMenu", (void *) glutDetachMenu },
90 { "glutDisplayFunc", (void *) glutDisplayFunc },
91 { "glutReshapeFunc", (void *) glutReshapeFunc },
92 { "glutKeyboardFunc", (void *) glutKeyboardFunc },
93 { "glutMouseFunc", (void *) glutMouseFunc },
94 { "glutMotionFunc", (void *) glutMotionFunc },
95 { "glutPassiveMotionFunc", (void *) glutPassiveMotionFunc },
96 { "glutEntryFunc", (void *) glutEntryFunc },
97 { "glutVisibilityFunc", (void *) glutVisibilityFunc },
98 { "glutIdleFunc", (void *) glutIdleFunc },
99 { "glutTimerFunc", (void *) glutTimerFunc },
100 { "glutMenuStateFunc", (void *) glutMenuStateFunc },
101 { "glutSpecialFunc", (void *) glutSpecialFunc },
102 { "glutSpaceballMotionFunc", (void *) glutSpaceballMotionFunc },
103 { "glutSpaceballRotateFunc", (void *) glutSpaceballRotateFunc },
104 { "glutSpaceballButtonFunc", (void *) glutSpaceballButtonFunc },
105 { "glutButtonBoxFunc", (void *) glutButtonBoxFunc },
106 { "glutDialsFunc", (void *) glutDialsFunc },
107 { "glutTabletMotionFunc", (void *) glutTabletMotionFunc },
108 { "glutTabletButtonFunc", (void *) glutTabletButtonFunc },
109 { "glutMenuStatusFunc", (void *) glutMenuStatusFunc },
110 { "glutOverlayDisplayFunc", (void *) glutOverlayDisplayFunc },
111 { "glutWindowStatusFunc", (void *) glutWindowStatusFunc },
112 { "glutKeyboardUpFunc", (void *) glutKeyboardUpFunc },
113 { "glutSpecialUpFunc", (void *) glutSpecialUpFunc },
114 { "glutJoystickFunc", (void *) glutJoystickFunc },
115 { "glutSetColor", (void *) glutSetColor },
116 { "glutGetColor", (void *) glutGetColor },
117 { "glutCopyColormap", (void *) glutCopyColormap },
118 { "glutGet", (void *) glutGet },
119 { "glutDeviceGet", (void *) glutDeviceGet },
120 { "glutExtensionSupported", (void *) glutExtensionSupported },
121 { "glutGetModifiers", (void *) glutGetModifiers },
122 { "glutLayerGet", (void *) glutLayerGet },
123 { "glutBitmapCharacter", (void *) glutBitmapCharacter },
124 { "glutBitmapWidth", (void *) glutBitmapWidth },
125 { "glutStrokeCharacter", (void *) glutStrokeCharacter },
126 { "glutStrokeWidth", (void *) glutStrokeWidth },
127 { "glutBitmapLength", (void *) glutBitmapLength },
128 { "glutStrokeLength", (void *) glutStrokeLength },
129 { "glutWireSphere", (void *) glutWireSphere },
130 { "glutSolidSphere", (void *) glutSolidSphere },
131 { "glutWireCone", (void *) glutWireCone },
132 { "glutSolidCone", (void *) glutSolidCone },
133 { "glutWireCube", (void *) glutWireCube },
134 { "glutSolidCube", (void *) glutSolidCube },
135 { "glutWireTorus", (void *) glutWireTorus },
136 { "glutSolidTorus", (void *) glutSolidTorus },
137 { "glutWireDodecahedron", (void *) glutWireDodecahedron },
138 { "glutSolidDodecahedron", (void *) glutSolidDodecahedron },
139 { "glutWireTeapot", (void *) glutWireTeapot },
140 { "glutSolidTeapot", (void *) glutSolidTeapot },
141 { "glutWireOctahedron", (void *) glutWireOctahedron },
142 { "glutSolidOctahedron", (void *) glutSolidOctahedron },
143 { "glutWireTetrahedron", (void *) glutWireTetrahedron },
144 { "glutSolidTetrahedron", (void *) glutSolidTetrahedron },
145 { "glutWireIcosahedron", (void *) glutWireIcosahedron },
146 { "glutSolidIcosahedron", (void *) glutSolidIcosahedron },
147 { "glutVideoResizeGet", (void *) glutVideoResizeGet },
148 { "glutSetupVideoResizing", (void *) glutSetupVideoResizing },
149 { "glutStopVideoResizing", (void *) glutStopVideoResizing },
150 { "glutVideoResize", (void *) glutVideoResize },
151 { "glutVideoPan", (void *) glutVideoPan },
152 { "glutReportErrors", (void *) glutReportErrors },
153 { "glutIgnoreKeyRepeat", (void *) glutIgnoreKeyRepeat },
154 { "glutSetKeyRepeat", (void *) glutSetKeyRepeat },
155 { "glutForceJoystickFunc", (void *) glutForceJoystickFunc },
156 { "glutGameModeString", (void *) glutGameModeString },
157 { "glutEnterGameMode", (void *) glutEnterGameMode },
158 { "glutLeaveGameMode", (void *) glutLeaveGameMode },
159 { "glutGameModeGet", (void *) glutGameModeGet },
160 /* freeglut extensions */
161 { "glutMainLoopEvent", (void *) glutMainLoopEvent },
162 { "glutLeaveMainLoop", (void *) glutLeaveMainLoop },
163 { "glutCloseFunc", (void *) glutCloseFunc },
164 { "glutWMCloseFunc", (void *) glutWMCloseFunc },
165 { "glutMenuDestroyFunc", (void *) glutMenuDestroyFunc },
166 { "glutSetOption", (void *) glutSetOption },
167 { "glutSetWindowData", (void *) glutSetWindowData },
168 { "glutGetWindowData", (void *) glutGetWindowData },
169 { "glutSetMenuData", (void *) glutSetMenuData },
170 { "glutGetMenuData", (void *) glutGetMenuData },
171 { "glutBitmapHeight", (void *) glutBitmapHeight },
172 { "glutStrokeHeight", (void *) glutStrokeHeight },
173 { "glutBitmapString", (void *) glutBitmapString },
174 { "glutStrokeString", (void *) glutStrokeString },
175 { "glutWireRhombicDodecahedron", (void *) glutWireRhombicDodecahedron },
176 { "glutSolidRhombicDodecahedron", (void *) glutSolidRhombicDodecahedron },
177 { "glutWireSierpinskiSponge ", (void *) glutWireSierpinskiSponge },
178 { "glutSolidSierpinskiSponge ", (void *) glutSolidSierpinskiSponge },
179 { "glutGetProcAddress", (void *) glutGetProcAddress },
180 { "glutMouseWheelFunc", (void *) glutMouseWheelFunc },
185 void *FGAPIENTRY glutGetProcAddress( const char *procName )
187 /* Try GLUT functions first */
189 for( i = 0; glut_functions[ i ].name; i++ )
190 if( strcmp( glut_functions[ i ].name, procName ) == 0)
191 return glut_functions[ i ].address;
193 /* Try core GL functions */
194 #if TARGET_HOST_WIN32
195 return( void * )wglGetProcAddress( ( LPCSTR )procName );
196 #elif TARGET_HOST_UNIX_X11 && defined( GLX_ARB_get_proc_address )
197 return(void * )glXGetProcAddressARB( ( const GLubyte * )procName );