I just started GLSL shader programing, but however I get
unrecognized preprocessing directive
whenever I put #version directive at the preprocessor directives header stack, though I included all opengl related headers and files within my source file,
Shader:
#version 400
in vec3 Color;
out vec4 FragColor;
void main()
{
FragColor = vec4(Color, 1.0);
}
how can I fix this issue?
Even preprocessor directives are illegal ( NVIDIA accepts it but AMD does not! ).
If this doesn’t help, give us some more information. E.g.
glGetString(GL_VERSION)andglGetString(GL_VENDOR).Refering to your comments you missunderstand how a shader is compiled. A shader cannot be compiled by a C++ compiler. Put your shader into a text file and load it at runtime, then call the compilation methods of OpenGL.