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 }