I am writing a simple OpenGL app, that applies a 2D texture to a triangle strip. My fragment shader does not compile (I am using PyOpenGL):
FRAGMENT_SHADER = shaders.compileShader("""#version 130
in vec4 color_v;
layout(location = 0) out vec4 color_out;
void main()
{
color_out = color_v;
};""", gl.GL_FRAGMENT_SHADER)
The error callback:
RuntimeError: ("Shader compile failure (0): ERROR: 0:3: 'layout' : syntax error syntax
error\n\n", ['#version 130\n in vec4 color_v;\n layout(location = 0) out
vec4 color_out;\n void main()\n {\n color_out = color_v;\n
};'], GL_FRAGMENT_SHADER)
and the call to load the texture into the FBO:
gl.glFramebufferTexture2D(gl.GL_FRAMEBUFFER, gl.GL_COLOR_ATTACHMENT0, gl.GL_TEXTURE_2D, self.ID, 0)
Can anyone help, please?