iDevGames Forums
Carbon or Cocoa for Games - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Carbon or Cocoa for Games (/thread-6464.html)

Pages: 1 2


Carbon or Cocoa for Games - Nick - Jul 8, 2004 10:39 AM

Which API do you use and why?


Carbon or Cocoa for Games - sealfin - Jul 8, 2004 11:20 AM

Neither, SDL; fast, free, easy, lots of documentation, cross-platform, and allows access to OpenGL, lots and lots of plug-in libraries for sound loading/playback, image loading, ad nauseum.


Carbon or Cocoa for Games - arekkusu - Jul 8, 2004 11:25 AM

Both, depending on what needs to be done. You can freely mix and match the two.

Cocoa is nice for overall app ease of use (events, document architecture, prefs, windowing etc)
Carbon has a native pixel format (ARGB GWorlds) and some useful Mac APIs are still Carbon-only (Quicktime, Resource Manager.)


Carbon or Cocoa for Games - Josh - Jul 8, 2004 12:12 PM

Cocoa, because I don't see the point of making it harder on myself by using Carbon.


Carbon or Cocoa for Games - Steven - Jul 8, 2004 01:05 PM

For games, neither - Allegro for cross-platform ability. For other apps, Cocoa, for ease of use and because it's so much more intuitive than Carbon.


Carbon or Cocoa for Games - AnotherJake - Jul 8, 2004 01:59 PM

Almost all Cocoa for any system UI stuff with plenty of Carbon thrown in here and there as needed for other things like QT. I try to replace Carbon code as Apple comes up with more/better Cocoa for equivalent functionality. 100% daily dosage of C for the actual game code and OGL and OAL for graphics and sound. No Cocoa or Carbon is allowed past my timer callback, so I guess I can't really say I use either for the actual game.


Carbon or Cocoa for Games - PowerMacX - Jul 17, 2004 09:03 AM

Cocoa, Carbon and SDL!!!
Well, I don't use Cocoa for games directly, but SDL uses it internally. I usually don't use Carbon, but for my entry on CreateMacGames latest contest I had to use speech synthesis and, as usual, while it was easier to set up and use on Cocoa, Carbon let's you control a lot of things not implemented in the Cocoa wrapper (like, for instance, the speed & pitch of the synth. voice).

Now, if I ever make a game wich requires a heavy GUI, Cocoa is the right choice.


Carbon or Cocoa for Games - BeyondCloister - Feb 27, 2005 04:09 AM

I use Cocoa as I came into Macs at the OS X stage so had no past history pre OS X and hence no need to reuse any existing code.

I also use Cocoa as I enjoy using Objective-C. You may ask why and I will tell you. It makes a nice change from the kind of coding I do in my day job.


Carbon or Cocoa for Games - Superpig - Feb 27, 2005 04:14 AM

Cocoa, because when I went into #idevgames and said "Can anyone help me get started" mdavis1982 pointed me to his template, which was written in Cocoa. Rolleyes


Carbon or Cocoa for Games - Malarkey - Feb 27, 2005 10:02 AM

Cocoa here because my home programming experience on the Mac started with OS X. Though I have played around with SDL and GLUT. And I've been meaning to start learning OpenGL as well.


Carbon or Cocoa for Games - Taxxodium - Feb 27, 2005 10:39 AM

Cocoa, because I feel it's closer to the system than Carbon (which is not really true, but it's just a feeling I have).

Also, with Cocoa some tasks are easier to code than with Carbon. The only thing that bothers me is that Cocoa doesn't have support for 2D arrays, but that's easily solved.

However, I sometimes use some Carbon functions, for example CGDisplay's functions are very handing, especially when you wanna do fades.

Basically I use Cocoa and C for just about anything, not just for games.


Carbon or Cocoa for Games - Josh - Feb 27, 2005 10:44 AM

Taxxodium Wrote:However, I sometimes use some Carbon functions, for example CGDisplay's functions are very handing, especially when you wanna do fades.
Technically, I'm not sure CGDisplay functions are part of Carbon but rather CoreGraphics.


Carbon or Cocoa for Games - OneSadCookie - Feb 27, 2005 03:05 PM

For most games, you'll be using very little of either. They each have their specific ups and downs as far as games go. Personally, I'm not a fan of AGL, so I tend to go with Cocoa, but I wouldn't say that either is necessarily a better choice.

Of course, as soon as you need a standard Mac OS widget, Cocoa wins hands-down.


Carbon or Cocoa for Games - DoG - Feb 28, 2005 03:07 AM

Nick Wrote:Which API do you use and why?

The poll is pretty borked. Carbon and Cocoa are not exclusive of each other (au contraire!), and most of the time you will use some parts of Carbon, even if you are coding in Obj-C. Also, just because some API is in C, it doesn't mean it's part of Carbon (QT, OpenGL, for example).

Carbon also contains a lot of stuff for which object-orientation doesn't work well enough to create a Cocoa wrapper.

Cocoa is dependent on the Obj-C language, and vice versa. Cocoa & Obj-C provide a very good object-oriented environment, if OO is your kind of tea. Also, Cocoa has a more advantageous learning curve than Carbon, but in the end you can do the same thing with either API.

Personally, I find Cocoa excellent for UI related things, but prefer to steer clear of Obj-C for performance reasons, hence prefer to code in C++ for core things (despite OSC's crusade againts evil).


Carbon or Cocoa for Games - PowerMacX - Feb 28, 2005 03:34 AM

DoG Wrote:The poll is [...] evil

Wink That's why I posted (last post, 7 months ago! before this thread resurrected), but didn't vote.