3 * Copyright (c) 2001 César Blecua Udías All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * CESAR BLECUA UDIAS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
20 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 #ifndef __SG_EXTENSIONS_HXX
25 #define __SG_EXTENSIONS_HXX 1
29 #if defined(__cplusplus)
37 static bool SGSearchExtensionsString(char *extString, char *extName);
38 bool SGIsOpenGLExtensionSupported(char *extName);
41 // don't use an inline function for symbol lookup, since it is too big
42 void* macosxGetGLProcAddress(const char *func);
45 inline void (*SGLookupFunction(const char *func))() {
48 return (void (*)()) wglGetProcAddress(func);
50 #elif defined( __APPLE__ )
51 return (void (*)()) macosxGetGLProcAddress(func);
54 // If the target system s UNIX and the ARB_get_proc_address
55 // GLX extension is *not* guaranteed to be supported. An alternative
56 // dlsym-based approach will be used instead.
57 #if defined( linux ) || defined ( sgi )
60 libHandle = dlopen("libGL.so", RTLD_LAZY);
61 fptr = (void (*)()) dlsym(libHandle, func);
65 return glXGetProcAddressARB(func);
72 /* OpenGL extension declarations */
73 #define GL_POINT_SIZE_MIN_EXT 0x8126
74 #define GL_DISTANCE_ATTENUATION_EXT 0x8129
76 typedef void (APIENTRY * glPointParameterfProc)(GLenum pname, GLfloat param);
77 typedef void (APIENTRY * glPointParameterfvProc)(GLenum pname, const GLfloat *params);
79 #if defined(__cplusplus)
83 #endif // !__SG_EXTENSIONS_HXX