When compiling project under OSX, compiler fails with an errors related to the window creation.
The error is related to the type of the delegate being passsed to the NSApp setDelegate method. The fix is quite simple - the NSFileManagerDelegate type needs to be replaced with NSApplicationDelegate.
After this fix, the other problem appears: when the application is ran, its window is not shown on top of other windows, yet the control over the mouse cursor is being taken. The fix is to pass activateIgnoringOtherApps:YES argument to the sharedApplication constructor.
Here is the patch (also put it in the attachments):
Index: source/Irrlicht/CIrrDeviceOSX.mm
===================================================================
--- source/Irrlicht/CIrrDeviceOSX.mm (revision 5652)
+++ source/Irrlicht/CIrrDeviceOSX.mm (working copy)
@@ -577,8 +577,8 @@
if (!CreationParams.WindowId)
{
[[NSAutoreleasePool alloc] init];
- [NSApplication sharedApplication];
- [NSApp setDelegate:(id<NSFileManagerDelegate>)[[[CIrrDelegateOSX alloc] initWithDevice:this] autorelease]];
+ [[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
+ [NSApp setDelegate:(id<NSApplicationDelegate>)[[[CIrrDelegateOSX alloc] initWithDevice:this] autorelease]];
// Create menu
Oh, by the way, this same fix could be applied to the
1.8branch to fix the problem there, just the line numbers are different:Last edit: Artem Shoobovych 2018-10-30
Applied in r5689 (trunk) and r5690 (1.8 branch). Thanks for report and patch!