Hi - I’m learning to use OpenGL and am following an online tutorial. However, the code for the shaders that they supply to begin with were written for version 1.5 and I am running version 1.2
I have spent a good couple of hours trying to figure out what is wrong by looking on the internet and modifying the code appropriately to account for the differences between the two versions. However I am currently stuck with the vertex shader (I think the fragment shader is OK) and I keep getting the
ERROR: 0:3: '' : syntax error #version
which apparently means something is still wrong with the code. Any help would be appreciated and I’m sure it’s really simple but I’m just not able to fix it…
Fragment shader
#version 120 core
out vec4 gl_FragColor;
void main()
{
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}
Vertex Shader
#version 120 core
in vec2 in_Vertex;
void main()
{
gl_Position = vec4(in_Vertex, 0.0, 1.0);
}
(Compiling with Mac OSX 10.9.2 Xcode)