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