From: ehofman Date: Tue, 24 Jun 2003 08:22:33 +0000 (+0000) Subject: Use the dlsym based approach on all unices and depreciate the glXGetProcAddressARB... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8a2e5cace87b171305a47f5b66ecf141b3c5e0e6;p=simgear.git Use the dlsym based approach on all unices and depreciate the glXGetProcAddressARB function --- diff --git a/simgear/screen/extensions.hxx b/simgear/screen/extensions.hxx index a15a4759..c1526986 100644 --- a/simgear/screen/extensions.hxx +++ b/simgear/screen/extensions.hxx @@ -49,28 +49,26 @@ bool SGIsOpenGLExtensionSupported(char *extName); void* macosxGetGLProcAddress(const char *func); #endif -inline void (*SGLookupFunction(const char *func))() { - +inline void (*SGLookupFunction(const char *func))() +{ #if defined( WIN32 ) && !defined(__CYGWIN__) && !defined(__MINGW32__) - return (void (*)()) wglGetProcAddress(func); + return (void (*)()) wglGetProcAddress(func); #elif defined( __APPLE__ ) - return (void (*)()) macosxGetGLProcAddress(func); -#else + return (void (*)()) macosxGetGLProcAddress(func); + +#else // UNIX + + // If the target system s UNIX and the ARB_get_proc_address + // GLX extension is *not* guaranteed to be supported. An alternative + // dlsym-based approach will be used instead. - // If the target system s UNIX and the ARB_get_proc_address - // GLX extension is *not* guaranteed to be supported. An alternative - // dlsym-based approach will be used instead. - #if defined( linux ) || defined ( sgi ) || defined(__CYGWIN__) || defined(__MINGW32__) - void *libHandle; - void (*fptr)(); - libHandle = dlopen("libGL.so", RTLD_LAZY); - fptr = (void (*)()) dlsym(libHandle, func); - dlclose(libHandle); - return fptr; - #else - return glXGetProcAddressARB(func); - #endif + void *libHandle; + void (*fptr)(); + libHandle = dlopen("libGL.so", RTLD_LAZY); + fptr = (void (*)()) dlsym(libHandle, func); + dlclose(libHandle); + return fptr; #endif }