Does anyone know how exactly I’d do this? I’ve been reading up, and everything seems to point to the apple website. I’ve downloaded what people said to download, but it doesn’t seem to have anything I can actually INSTALL with, just things that I’m supposed to install somehow. Try as I might, I haven’t been able to find a guide that actually explains how I’m supposed to get it all working. Does anyone know?
I program opengl on my powerbook and it required no setup… opengl & glut are already installed with the operating system… you just need to include it in your projects.
But that doesn’t seem to work. Do I have to compile it some special way or something? Termain commands like “which glut” and “which opengl” return nothing, so I’m not 100% sure they’re already installed.
When I try to compile code with those includes, it throws an error about the files I’m including not existing.
change that to say #include <GLUT/glut.h> // thats it
And in xcode you need to set up a package to include OpenGL.framework and GLUT.framework
Right-click the project file in xcode and click add frameworks… and browse to them
Yes, you do not need those other headers you previously posted (gl.h, glu.h).
And when you are creating an Xcode project, the easiest way to do it is create an empty project, add a Carbon target, add all your source code files, then add the frameworks “Cocoa”, “GLUT”, and “OpenGL”, and then you’re set to go!
Also, you can follow the NeHe tutorial found on my website (once you’ve done that, you can move right on to NeHe lesson 2): http://dhost.info/joetheprogrammer/wordpress/?page_id=47
(sometimes it’s down because of excess traffic, so if that happens, try again later)
it was a NeHe tutorial in the first place…must have clicked the wrong one. I’m using Smultron for my editing though, is there anything different I need to do because of that?
After changing the main() block to what you suggested, it threw these errors:
test.cpp: In function 'int main(int, char**)':
test.cpp:24: error: 'init' was not declared in this scope
test.cpp:25: error: 'createLights' was not declared in this scope
test.cpp:26: error: 'display' was not declared in this scope
test.cpp:28: error: 'reshape' was not declared in this scope
again, those are functions that you have to write yourself… i cant write the entire program for you… thats just a skeleton…
init, createLights, display, and reshape are all things that you need to write somewhere else… (createLights is optional)
That means that everything is now compiling. You need to add ‘-framework OpenGL -framework GLUT’ to your compile command to allow the linker to find those functions.