Setting up a coding environment
All you need to do is download and install Xcode. If you want to compile things using X11 or Xquarts, then you would need to install those as well. You may download Xcode through the App Store, you may download Xquartz from here:
http://xquartz.macosforge.org/landing/If you prefer to work with Eclipse, you may download and install it from here:
https://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/lunasr1aSetting up the OpenGL libraries
By default, Mac OS X has all of the OpenGL libraries you need package in two frameworks: GLUT.framework and OpenGL.framework. These, however, are not set up for Xquartz. If you would like to use Xquartz, you will have to download the glut and glew sources and compile them yourself:
http://freeglut.sourceforge.net/http://glew.sourceforge.net/