View Full Version : SDL, Cocoa or Carbon?
Taxxodium
2004.01.03, 10:16 AM
I'm gonna start working on a simple 3D engine but I haven't decided in which API I wanna make it.
So I wanna ask you pro's what API should I use, SDL, Carbon or Cocoa?
Cocoa, is powerful for GUI stuff but it might be slow for event handling.
Carbon is more powerful than Cocoa.
SDL is crossplatform, but this might be a weak point as it may be slow.
What would be the best decision?
NCarter
2004.01.03, 10:40 AM
A word of advice: don't tie your 3D engine to any of those APIs.
Ideally your core 3D engine code should be as independent as possible so that you can transplant it into any API, operating system or hardware you choose. That way you can change your mind about what you want to support at a later stage without breaking all your core code or any games which are based upon it.
Of course, you'll have to meet the operating system somewhere to perform certain tasks such as setting up your 3D view, loading and saving data, producing sound or doing system GUI stuff, but I'd recommend that you keep that code insulated from everything else so you can easily swap it for something else.
BTW, what language are you planning to use?
[EDIT: To answer your actual question, I'm using Carbon at the moment, but it has been annoying the hell out of me. It's a lot better than the old Classic Toolbox, but it's still twisty and perverse. I wish it were more object oriented. I can't really comment on Cocoa and SDL because I've only begun to scratch their surface.]
skyhawk
2004.01.03, 02:25 PM
I'm gonna start working on a simple 3D engine but I haven't decided in which API I wanna make it.
So I wanna ask you pro's what API should I use, SDL, Carbon or Cocoa?
the current version of SDL for OS X, I believe uses Cocoa, but I would just use pure cocoa.
Cocoa, is powerful for GUI stuff but it might be slow for event handling.
cocoa is not slow
Carbon is more powerful than Cocoa.
carbon is not more powerful than cocoa.
SDL is crossplatform, but this might be a weak point as it may be slow.
SDL would make different aspects of your game easier. But I don't believe it is slower.
People tend to be stupid about the word "slower". ANYTHING can be slow if you program it bad. ruby can be faster than assembly if the aassembly guy writes bad code. That being said, you shouldn't ever write bad code :p
What would be the best decision?
whatever you are most knowledgeable in
Taxxodium
2004.01.03, 02:57 PM
Well I was going to write the OpenGL core in C++ and then use SDL to have a place where I could do my drawings. So I think I'll stick with that for the time being.
Thanks for the input.
PowerMacX
2004.01.06, 01:23 AM
Hi, I just read this post today so probably you have already started coding. Anyway, I'm developing an OpenGL game in C++, and using SDL to handle events and window/OpenGL context creation. Also, I'm using SLD Mixer for sound.
I isolated the SDL calls in 2 files/classes, so switching to other API later is easy.
DJBlufire
2004.01.09, 04:09 PM
I ran into the same problem you did a couple weeks ago and ended up going the same route, D++ with SDL. It's going very well so far, but my only complaint is the very, very slow compile times resulting from combining Obj-C (from SDL's use of Cocoa) and C++ (my program). Other than that, speed doesn't seem to be an issue.
Taxxodium
2004.01.09, 04:53 PM
Well, I have started developing the engine (I can draw a triangle :D ) in C++/SDL. I'm quite satisfied for this choice and currently the Open GL code is separated from the SDL code, so that's a good thing.
Thanks for the feedback!
PS: Don't think my engine will be a Halo killer, cause it won't. Does anyone have experience with shadows in 3D? I'm not that advanced yet but some knowledge on how to handle shadows might be good for future use :)
OneSadCookie
2004.01.11, 01:58 AM
Shadows are about the hardest topic in 3D graphics. I suggest you steer clear of them for a while ;)
This is about the simplest technique. The paper is very good, too. Performance... well, that's another issue ;)
http://developer.nvidia.com/object/robust_shadow_volumes.html
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.