I had intended to use it – I commented the usage out, in fact to see if that would change anything, to no avail.
I’ve fooled around a bit since then and altho I would swear it was just the presence of that variable before (since switching it to a float and removing the usage worked), now it hinges more on it’s use:
uniform sampler2D TexMap;
void main() {
// gl_FragColor = gl_Color*texture2D(TexMap,gl_TexCoord[0].st);
gl_FragColor = vec4(0.8,0.8,0.8,1.0);
}
Ie, commenting that line out makes it work. Now, I don’t understand the line very well, I just copied it out of the red book (7th ed, example 15-8) BUT at this point the shader 1) has not been used, 2) compiled without error, and AFAICT this is just intended to “provide the same results as using GL_MODULATE”.
I’m not getting any kind of error at this point – I noticed it because subsequently I get an INVALID_OPERTATION using the shader, which I traced it back to the linker failing. Here’s the bailout:
Shaders[2] = glCreateProgram();
glAttachShader(Shaders[2],Shaders[0]);
glAttachShader(Shaders[2],Shaders[1]);
glLinkProgram(Shaders[2]);
glGetProgramiv(Shaders[2],GL_LINK_STATUS, &err);
if (err == GL_FALSE) {
fprintf(stderr, "glLinkProgram() failed %u
", Shaders[2]);
while ((err=glGetError()) != GL_NO_ERROR) reportError(err);
return -1;
}
glUseProgram(Shaders[2]);
Again, if this exits, it does not report anything other than the bad linkage.