[ Using XCode | Using GNU tools | Porting to/from OS X ]
This will get you an XCode project with all of the necessary frameworks added to it.
File:New Project.This will get you going on the command line. This ought to be easier if you plan on moving between operating systems.
coming soon!
OpenGL == cross-platform, right? Almost. Porting an existing OpenGL application to or from OS X is largely a matter of headers (I think...). For some unknown reason, OS X puts the headers in a different location in the include path than Windows and Linux (and probably a bunch of other *n?x OSes). Here's the skinny:
| Header Description | Mac OS X | The Rest of the World |
|---|---|---|
| GL - OpenGL Base | #include <OpenGL/gl.h> |
#include <GL/gl.h> |
| GLU - OpenGL Utility | #include <OpenGL/glu.h> |
#include <GL/glu.h> |
| GLUT - OpenGL Utility Toolkit | #include <GLUT/glut.h> |
#include <GL/glut.h> |
The other headache(?) that you will come across if you are doing things on the command line is what switches to feed gcc. The proper Mac switches are available above, but what do you do if you want to move your app to Linux? Or, heaven forbid, Windows?
Well, for Linux, you will replace those short little -framework flags with something like the following (stolen, unceremoniously, from the CS280: Real-time Graphics class website at UCSB):
-lglut -lGLU -lGL -L/usr/X11R6/lib/ -lXmu -lXi -lXext -lX11 -lXt
For Windows I have, admittedly, no idea.