The following patch simplifies platGetProcAddress() in utOpenGL.cpp:
Code:
Index: Horde3D/Source/Horde3DEngine/utOpenGL.cpp
===================================================================
--- Horde3D/Source/Horde3DEngine/utOpenGL.cpp (revision 763)
+++ Horde3D/Source/Horde3DEngine/utOpenGL.cpp (working copy)
@@ -15,7 +15,11 @@
#include <cstdlib>
#include <cstring>
+#if defined PLATFORM_MAC
+#include <dlfcn.h>
+#endif
+
namespace glExt
{
bool EXT_framebuffer_object = false;
@@ -239,18 +243,7 @@
#elif defined( PLATFORM_WIN_CE )
return (void *)eglGetProcAddress( funcName );
#elif defined( PLATFORM_MAC )
- CFStringRef functionName = CFStringCreateWithCString( kCFAllocatorDefault, funcName, kCFStringEncodingASCII );
- CFURLRef bundleURL = CFURLCreateWithFileSystemPath(
- kCFAllocatorDefault, CFSTR( "/System/Library/Frameworks/OpenGL.framework" ), kCFURLPOSIXPathStyle, true );
- CFBundleRef bundle = CFBundleCreate( kCFAllocatorDefault, bundleURL );
-
- void *function = CFBundleGetFunctionPointerForName( bundle, functionName );
-
- CFRelease( bundle );
- CFRelease( bundleURL );
- CFRelease( functionName );
-
- return function;
+ return dlsym(RTLD_DEFAULT, funcName);
#else
return (void *)glXGetProcAddressARB( (const GLubyte *)funcName );
#endif
Index: Horde3D/Source/Horde3DEngine/utOpenGL.h
===================================================================
--- Horde3D/Source/Horde3DEngine/utOpenGL.h (revision 763)
+++ Horde3D/Source/Horde3DEngine/utOpenGL.h (working copy)
@@ -37,9 +37,7 @@
# define GLAPI
# define GLAPIENTRY
# define GLAPIENTRYP *
-# ifdef PLATFORM_MAC
-# include <Carbon/Carbon.h>
-# else
+# ifndef PLATFORM_MAC
extern "C" void (*glXGetProcAddressARB( const unsigned char *procName ))( void );
# endif
#endif