Hello Dave:
Sorry I forgot to add a step so again here is what I did:
I downloaded the redbook samples from:
I arbitrarily chose planet.c and changed the extension from .c to .cpp.
(The reason why I changed it was that I am continuing learning C++ in class at college.)
I opened Xcode and created a new project from the Command Line Utility and selected C++ tool.
I deleted the main.cpp code and used the Action popup menu to add an existing file from the one above planet.cpp.
added: Also used the Action popup menu to include the following frameworks: GLUT.framework and OpenGL.framework.
I changed the includes from
#include <GL/glut.h> #include <stdlib.h>
to the following:
#include <GLUT/glut.h> #include <iostream>
I compiled the code and it completely succeeded without warnings as it should.
As I said, it does not require Cocoa and shouldn't. I take classes at college for continuing education. Some C++ and OpenGL students complain about Xcode not being user friendly. I can get around Xcode by experimenting but some get frustrated with Apple's IDE and give up. MS Studio is usually much easier to use.
There is a large group of young people wanting to learn the ins and outs of Apple Hardware and that includes programing games with OpenGL. To experiment, these young people need GLUT. GLUT should be an opening door for these young people, but Apple does not care. Tell me if I am wrong.
Jesse
On Nov 28, 2009, at 10:47 AM, Dong Feng wrote:
Apple's version of GLUT is on top of Cocoa so I guess linking to Cocoa framework is required, according to:
I don't think Cocoa is required. I've used some simple C++ examples with GLUT - all I had to do was add the OpenGL and GLUT frameworks. Here's a short screencast made on Leopard showing how to do it.
Dave
|