PDA

View Full Version : Carbon Event Loop



bobGL
12-20-2007, 07:16 PM
Im porting my Linux code to MAC OS, I've successfully create a Carbon window handling my OpenGL context (double buffer, antialias etc...) Now I need to implement the event loop to handle: mouse, keyboard, resize etc... can someone point me out a tutorial somewhere on how to handle the event loop using carbon.

Tks in advance,

Cheers,

nib
12-20-2007, 09:41 PM
If you have the developer tools installed, then you can probably find examples in:

/Developer/Examples

There is a carbon folder there.

I recommend you not use carbon. In fact, its easier to use cocoa. What tripped me up initially was the thinking that I could not integrate my c++/c code with objective c. This is false. If you make your file names .mm then you can mix objective c and c++, for instance. Its really incredible. Carbon cannot be built in 64 bits too -- its not the path to the future.

I don't recommend glut either...

Just my two cents. You don't want to have to rebuild multiple things twice like me. :)

OneSadCookie
12-21-2007, 04:27 PM
As nib says, do not write new Carbon code. You'll just make your life more difficult as it gets phased out. Cocoa is not only the future, it is easier and better-documented too. If you know C++ already it'll take you all of a day to learn ObjC, and as nib says, ObjC can be freely mixed with C and C++.