Search This Blog

Tuesday, March 13, 2012

GLSL project in XCode4

To create an shader based OpenGL command line app using XCode4 follow these steps (at least they worked for me):

  1. Create a "Command Line Tool" application 
  2. Add the "OpenGL" and "GLUT" frameworks (click on the project -> target, "Build Phases" tab and add them in the "Link Binary With Libraries" panel)
  3. Write the main to setup GLUT and load/use shaders
  4. Write your shaders
  5. In the Project Setting -> Target -> Build Phases, drag the shader files onto the  "Compile Sources" panel
  6. In the Project Setting -> Target -> Build Phases, add a new and "Copy Files" phase and drag the shaders onto it. Make sure to set the "Destination" option to "Executables"
Hope this helps!