From 27c4dc092052424bb91525f2dd6a3c55ba1bbbf3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 23 Jul 2003 20:50:56 +0000 Subject: [PATCH] From Sean, fix for Sun windows extension checking. --- include/osg/GLExtensions | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/osg/GLExtensions b/include/osg/GLExtensions index 342da8753..95f28b0fd 100644 --- a/include/osg/GLExtensions +++ b/include/osg/GLExtensions @@ -45,8 +45,11 @@ extern SG_EXPORT bool isGLExtensionSupported(const char *extension); inline void* getGLExtensionFuncPtr(const char *funcName) { #if defined(WIN32) + return (void*)wglGetProcAddress(funcName); + #elif defined(__DARWIN_OSX__) + std::string temp( "_" ); temp += funcName; // Mac OS X prepends an underscore on function names if ( NSIsSymbolNameDefined( temp.c_str() ) ) @@ -55,8 +58,16 @@ inline void* getGLExtensionFuncPtr(const char *funcName) return NSAddressOfSymbol( symbol ); } else return NULL; + +#elif defined (__sun) + + static void *handle = dlopen((const char *)0L, RTLD_LAZY); + return dlsym(handle, funcName); + #else // all other unixes + return dlsym(0, funcName); + #endif }