In article <indianajoe3-0F625F.firstname.lastname@example.org>,
Indiana Joe <email@example.com> wrote:
> I'm trying to write the, "Great American MMO" as a way to teach myself
> Objective-C. I was going to use an open source library to help with the
> 3D rendering and animation. However, most of them are written in C++,
> not Objective-C. So I have a couple of questions.
> 1) Is it more trouble than it is worth to try to get a C++ library
> working with an Objective-C program?
It is very easy to get a C++ library working in an objective-C program.
You can write a simple C interface that returns opaque pointers to be
held by Objective-C objects, and you can use a .mm suffix for
Object-C++, which allows you to use both Objective-C and C++ constructs.
Some of the gotchas: Objective-C isn't compatible with C++ exceptions
and Objective-C exceptions aren't compatible with C++. Not all
Objective-C runtimes will automatically call C++ constructors and
destructors for C++ objects that are fields of Objectove-C objects
(Objective-C objects are never fields of other objects, Objective-C
objects are always referenced by pointer.
> 2) What is a good reference for C++ on the Mac? (I am using the latest
> version of Xcode and Tiger, if it makes a difference.)
Should be standard C++. The standard is a good reference.
> Oh, if anyone has a recommendation for an open-source 3D library, I'm
> interested in that too.
OpenGL is already present. Look for the NSOpenGLView examples on Apple's
web site (in developer.apple.com in Sample Code)
Mesa is an open source library layered on top of OpenGL that provides
higher level modelling constructs. OpenInventor is an open source
library layered on top of OpenGL that is more tuned for high performance
http://www.idevgames.com/ is a good place to learn about developing Mac