I've been looking into running a GLUE application under OS X, and hit the error described on http://www.ogre3d.org/wiki/index.php/MacLibrary (a slew of NSAutreleasepool warnings followed by a "*** Uncaught exception: <NSInternalInconsistencyException> Error (1002) creating CGSWindow") and a crash in SDL.set_video_mode on its first glGet call.
This (completely naïve) approach based on the suggestions offered did not seem to do much good:
Index: src/post_modules/SDL/SDL.cmod =================================================================== RCS file: /pike/data/cvsroot/Pike/7.7/src/post_modules/SDL/SDL.cmod,v retrieving revision 1.29 diff -u -r1.29 SDL.cmod --- src/post_modules/SDL/SDL.cmod 12 Nov 2005 20:37:07 -0000 1.29 +++ src/post_modules/SDL/SDL.cmod 29 Jul 2007 21:07:04 -0000 @@ -151,6 +151,13 @@ *! */ PIKEFUN void init(int flags) { + /* init needed on XDarwin: http://www.ogre3d.org/wiki/index.php/MacLibrary */ + void* cocoa_lib; + cocoa_lib = dlopen( "/System/Library/Frameworks/Cocoa.framework/Cocoa", RTLD_LAZY ); + void (*nsappload)(void); + nsappload = (void(*)()) dlsym( cocoa_lib, "NSApplicationLoad"); + nsappload(); + if( SDL_Init(flags) == -1) { Pike_error("SDL Initialization failed: %s\n", SDL_GetError()); }
pike-devel@lists.lysator.liu.se