GLUT for Mac
There is no need to install GLUT on a Mac. It comes as part of the package. If you have XCode, you can make a GLUT application. YAY!
Set up a GLUT program
- Start XCODE
- Create a New Project
- Select Command Line Utility from the list on the left
- Select the icon for C++ Tool on the right (Select Standard Tool if you are coding in C)
- Click Choose...
- Name your project, choose a location, and click Save
- Replace main.cpp with the lab template or with the sample code you want to try out.
For new projects, you can start from this GLUT template.
- Right click on the project group in "Groups and Files" and click Add | Existing Frameworks...
- Add both the OpenGL and GLUT frameworks.
- NOTE: Most GLUT examples on the web are targeted at Windows or Linux. Make sure GLUT is included via #include <GLUT/GLUT.h>. There is no need to include gl.h or glu.h in a glut project.
Please note that while GLUT is very easy to use and wonderfully
cross platform it is a bit buggy (eg. try resizing in a direction that
strictly shrinks the window...) and feature limited. You will want to
use something better maintained (SDL) or write your own window
management code for best results.