My program compiles and runs fine in Mac OS X, but my event receiver can't catch events from the keyboard. If the program was launched from a terminal, the terminal catches my keystrokes. If I don't launch it using a terminal (i.e., just double-clicking in Finder), the keystrokes are caught by whatever program is underneath mine. In other words, my program never receives focus... so I can't enter keyboard input.
Has anyone else experienced this problem? Has anyone found a solution?
I've done quite a bit of searching, and found that this was a bug in older versions of irrlicht... does it still exist in 1.4?
I'm compiling using gcc.
Can't catch keyboard events in Mac OS X
Being using irrlicht on OSX for a year and never had that happen. Couple things to make sure, your using a Cocoa app frame work and not Carbon. Look at how the examples are setup in the irrlicht project. MeshViewer for example.
Also try building some of the examples that come with irrlicht and see if they have the same problem.
Also try building some of the examples that come with irrlicht and see if they have the same problem.
Do the Irrlicht examples work out-of-the-box for you on a Mac?
After looking around a bit, I found that I had to edit "LDFLAGS" like this:
(I got this from http://www.irrlicht3d.org/wiki/index.ph ... ngOnMacOSX)
Note that I'm using both Carbon and Cocoa... but I don't notice any difference when removing the Carbon framework.
I compiled and ran a couple of the examples, bot just got blank windows (Including the HelloWorld example). Somehow, my program runs better than the examples...
Is there something else I need to #include, or add to the Makefile? I couldn't compile the Irrlicht engine, so I just used the pre-compiled libIrrlicht.a... would this be a problem?
Thanks.
After looking around a bit, I found that I had to edit "LDFLAGS" like this:
Code: Select all
LDFLAGS = -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework Cocoa -framework OpenGL -framework Carbon
Note that I'm using both Carbon and Cocoa... but I don't notice any difference when removing the Carbon framework.
I compiled and ran a couple of the examples, bot just got blank windows (Including the HelloWorld example). Somehow, my program runs better than the examples...
Is there something else I need to #include, or add to the Makefile? I couldn't compile the Irrlicht engine, so I just used the pre-compiled libIrrlicht.a... would this be a problem?
Thanks.
yes. go into source/Irrlicht/MacOSX and use xcodebuild not make ... Corse I'm not sure how you plan to test any 3D as you can not export a 3D visual session back over ssh.
As for carbon apple does not support it anymore and hasn't for a few years. Carbon is PPC only. Are you including both in your project? If so then it will definitely not link.
As for that tutorial to build an X11 application under OSX, you will need all the GNU libraries install. I use fink ( http://www.finkproject.org/ ) myself. This would also mean anyone running it on OSX would need the GNU libraries installed and X11 which does not come preinstalled on OSX.
Also that tutorial isn't very good
1) There is no Carbon includes anywhere in Irrlicht
2) Source files are text and have not being bult against anything at download time
As a side not 3D rendering using X11 under OSX is a little slow. But if thats your goal then you do not need to link to Cocoa or Carbon only OpenGL
http://developer.apple.com/qa/qa2007/qa1567.html
As for carbon apple does not support it anymore and hasn't for a few years. Carbon is PPC only. Are you including both in your project? If so then it will definitely not link.
As for that tutorial to build an X11 application under OSX, you will need all the GNU libraries install. I use fink ( http://www.finkproject.org/ ) myself. This would also mean anyone running it on OSX would need the GNU libraries installed and X11 which does not come preinstalled on OSX.
Also that tutorial isn't very good
As an apple developer of 17 years the above quote is not true and doesn't make any sense.You'll notice the last line. This is required because libIrrlicht.a was built against the Cocoa, Carbon, and OpenGL frameworks. If you don't add this then you will end up with a slew of undefined symbols.
1) There is no Carbon includes anywhere in Irrlicht
2) Source files are text and have not being bult against anything at download time
As a side not 3D rendering using X11 under OSX is a little slow. But if thats your goal then you do not need to link to Cocoa or Carbon only OpenGL
http://developer.apple.com/qa/qa2007/qa1567.html
Last edited by varmint on Fri Jan 04, 2008 7:49 pm, edited 1 time in total.
Irrlicht needs an aalib device!varmint wrote:yes. go into source/Irrlicht/MacOSX and use xcodebuild not make ... Corse I'm not sure how you plan to test any 3D as you can not export a 3D visual session back over ssh.
I'm not promising to make one of course, but I'd weep with joy if someone made one.
http://pdb.finkproject.org/pdb/browse.php?summary=aalibbitplane wrote:Irrlicht needs an aalib device!varmint wrote:yes. go into source/Irrlicht/MacOSX and use xcodebuild not make ... Corse I'm not sure how you plan to test any 3D as you can not export a 3D visual session back over ssh.
I'm not promising to make one of course, but I'd weep with joy if someone made one.
xcodebuild is the same as opening XCode GUI and compiling, so xcodebuild does not need or use aalib. And as far as I know the linux irrlicht build doesn't use aalib either.