I’m trying to write a hello world for OpenGL on Mac (Lion). I’ve found some related post or youtube tutorial, but most of them require XCode. I’m OK with XCode, but I thought there should be some simpler approaches to write just a hello world, similar to write a .cpp file in vim under terminal, compile and run. (of course install libraries if needed beforehand)
Any idea or suggestion?
If you are using OSX I would highly recommend using XCode and use NSOpenGLView. This book has a lot of material regarding the several APIs you can use. GLUT is definitely the quickest to get to grips with, and to set up.
If you want to use GLUT and compile at the terminal you could try this:
and then compile with:
That should do the trick. I would say though don’t try and fight XCode work with it, it will save you time and frustration.