Hi! I am using Irrlicht in Mac OSX 10.6 with XCode 3.2.1 and while the engine is great I have found that Mac OSX support is still far from perfect...
My biggest struggle with Irrlicht 1.6 in Mac is that it does not catch the keyboard input when the application runs in a window (it certainly works when the application runs in fullscreen, see createDevice() or createDeviceEx()). However, running in fullscreen is not the solution because sometimes (e.g, when the program crashes) the Irrlicht engine does not restore the Mac desktop (leaving the screen with a frozen rendering instead) and you must reboot the machine. There are other issues with the Irrlicht gui as well but this is probably left aside for a future post. In addition, the Irrlicht window does not appear on top of the other windows (which is quite annoying specially when you add a FPS camera animator node).
Regarding the keyboard problem, I have been diving into the CIrrDeviceMacOSX and my guess is there there is a problem with the routing of keyboard events (keyboard input is routed from the NSApp down to the NSWindow down to the Irrlicht event callbacks). In my desperation, I have been thinking in writting a Mac-specific modification of the Irrlicht engine but my current "solutions" will not preserve compatiblity with the other devices (i.e., Windows or Linux).
It would be great if we can make Irrlicht more compatible with OSX, any ideas/future plans to fix the keyboard problem and the other things?
Lack of keyboard input in a windowed Mac OS X application
Ok, thank you. I have fixed my stupid problem that has bothered me for the last week. Actually, I have modified the Irrlicht engine to work with the wiimote and at first I thought that maybe I have introduced some bugs inadvertently. The real problem was with the x-code project configuration, the key input is not redirected to the Irrlicht event callbacks in a command-line application, you must pick the cocoa application instead and everything works just fine.
Err... could you please explain this procedure a little bit more in details? I'm experiencing the same issue as you with editboxes... have you created a new Cocoa project rather than a standard command line one?msxfan wrote:Ok, thank you. I have fixed my stupid problem that has bothered me for the last week. Actually, I have modified the Irrlicht engine to work with the wiimote and at first I thought that maybe I have introduced some bugs inadvertently. The real problem was with the x-code project configuration, the key input is not redirected to the Irrlicht event callbacks in a command-line application, you must pick the cocoa application instead and everything works just fine.
Seems like I have to struggle with exactly the same problem.
I'm running irrlicht 1.7.2 on Mac OS X 10.6.7 with XCode4. And therefore GCC 4.2/LLVM. At the moment I'm able to build irrlicht and the application based on irrlicht. We're using cmake/make for our build automation. The hint from msxfan to use the Cocoa App template in XCode is not the best solution for me.
So does anybody know how to fix the problem within the make environment?
I'm running irrlicht 1.7.2 on Mac OS X 10.6.7 with XCode4. And therefore GCC 4.2/LLVM. At the moment I'm able to build irrlicht and the application based on irrlicht. We're using cmake/make for our build automation. The hint from msxfan to use the Cocoa App template in XCode is not the best solution for me.
So does anybody know how to fix the problem within the make environment?
Re: Lack of keyboard input in a windowed Mac OS X applicatio
I'm not certain if this is the exact same problem, but for me, when using CMake and make rather than XCode, the solution to get input working was to package the binary as a .app
See here:
http://jesper.sarnesjo.org/blog/cocoa-s ... e-builder/
So ensure your binary named APPNAME is in a directory structure like:
APPNAME.app/Contents/MacOS/APPNAME
and then run it by clicking on the APPNAME.app folder.
I guess then it is considered a proper "app" according to the Mac OS and gets given input. Plus you get an icon in the Dock too.
See here:
http://jesper.sarnesjo.org/blog/cocoa-s ... e-builder/
So ensure your binary named APPNAME is in a directory structure like:
APPNAME.app/Contents/MacOS/APPNAME
and then run it by clicking on the APPNAME.app folder.
I guess then it is considered a proper "app" according to the Mac OS and gets given input. Plus you get an icon in the Dock too.
Re: Lack of keyboard input in a windowed Mac OS X applicatio
msxfan could you please explain how u actually did that? because i see no configuration about this issue in my project... :S
Re: Lack of keyboard input in a windowed Mac OS X applicatio
ok i think i now understand your solution: instead of creating a command-line application, one has to create a cocoa application.