I know this sounds like an odd "problem" but stick with me.
I have a graphics card which supports OpenGL 3.3.
However, I am writing code to target OpenGL 2.0 and therefore GLSL version 1.1.
I have the following GLSL code:
#version 110
in vec4 position; // x,y,z,w (ignores w)
uniform mat4 mvpMatrix;
void main() {
gl_Position = mvpMatrix * position;
}
As you can see, I have specified the GLSL version to be #version 110.
You might also notice that I use the 'in' keyword for the vec4 position.
This keyword is not available in the version of GLSL that's specified but it compiles without error on my graphics card (which again, supports OpenGL 3.3).
The correct keyword should be 'attribute'.
When tested on a computer that only has OpenGL 2.1 the shader code gets a compile error.
Why does my compiler not also compile with an error? Shouldn't it being compiling the shaders with version 110 compliance and report the appropriate error?
Is there anyway to check for this? Maybe it's a warning or something? I don't know. Help!
Also, I am programming in Java using LWJGL. If that helps any, but I don't think it has anything to do with the problem.
Edit:
I added code to always check the info log after a shader compile and it still doesn't report anything when using the 'in' keyword.