I'm trying to learn OpenGL and the material is using #version 330 in shaders. I can compile it successfully, but when I try to run it, it complains Version 330 is not supported.
In my source code, I use free glut and OpenGL framework in Xcode. If I also include these two lines of code
glutInitContextVersion(3,1); glutInitContextFlags(GLUT_CORE_PROFILE);
it cannot be compiled.
My mac is MacBook Pro Mid 2012. It should support OpenGL4.1 according to apply.
So how can I compile version 330 shaders?