Quote:Originally posted by Jake how hard is it to port a Cocoa project to C++ if im using Open GL?

If you're planning on going cross-platform, I'd suggest attempting to be cross-platform from the start. That means no Cocoa. I believe there are open-source implementation of Obj-C (OpenStep?) but I doubt that you'll have all of the functionality of the Cocoa classes (NSWhatever), which is really one of the strong reasons to use Cocoa in the first place.

Quote:2. Is it as fast as carbon for fullscreen Open GL games? (or close to the same speed)

OpenGL has nothing to do with Cocoa specifically (OpenGL is still a library that your Obj-C compiled application calls), so performance should be exactly the same. Granted, you'll be using different methods to create your OpenGL context and what-not.

Cocoa's method dispatchs are slower than C++ function calls. if you're doing heavy nested looping you might notice a difference. Although realistically you're not going to notice a speed difference; other parts of your program take vastly much more time to execute.

The nice thing about Cocoa is the dynamic typing (hence the slow method dispatch), this aleviates many method type errors and gives you readable exceptions in your console with which to debug your code.

How easy it is to port the code depends on how much Cocoa you use, not how much OpenGL. Objective-C can do some things that C++ simply cannot do (or cannot do without a lot of work are restructuring of the program).

And vice versa, I have to add &#x2014; there's plenty of stuff which you can do in C++ which doesn't translate nicely to Objective C, though I tend to think it's less important than the stuff that's missing going the other way

...and as for the speed issues, you can always find ways to compensate, by violating the dynamism, if you have to. In big loops and other confined spaces, you can call methods just as though they were functions -- of course, if the method you are calling itself calls a lot of methods in the usual way, you might be out of luck. :?:

Most of the setup for OpenGL in Cocoa is trivial. The issue, as mentioned, is partially whether you are using the native interface on OS X (Cocoa, Carbon, whatever). If so, look at another interface for U.I. etc. If you are running full screen, the amount of native code is small. Just isolate it from the OpenGL!