The following is a description of how one student got opengl and glut to work on his macintosh with OS X. Note that there may be other methods, this is just what worked for this student. This information is shared as is.

First, a basic C preprocessor macro needs to be used to use the proper header files::

#ifdef __APPLE__
#include
#else
#include
#endif

You can see how the headers are actually spelled and such by looking at them in /System/Library/Frameworks/OpenGL.framework and /System/Library/Frameworks/GLUT.framework (there is a Headers directory which is a symlink to the header files).

As for compiling, if you use gcc/g++ (first one if you only use C, second if you use C++) you need to compile with ``-framework Foundation -framework OpenGL -framework GLUT`` as command-line options to include the frameworks in the include paths. If you use XCode (Apple's IDE) you can then just include the frameworks through a menu option (don't know it since I am a UNIX nut).

All of this is available off of the Developer CD that comes with every copy of OS X. It can also be downloaded from Apple's web site (developer.apple.com, I think). Either way it is all free.

As I mentioned in lab, though, you can't resize the window beyond its initial size and maximized. Probably has to do with the hack that they use for GLUT apps to make OS X think they are actual applications (normal OS X apps are a directory with a specific hierarchy and configuration files).