I have setup the usual code for setting up a GLSL program, but after error checking and not getting errors, glUseProgram doesn’t change the program. I’m wondering if the glGetShaderInfoLog and glGetProgramInfoLog don’t turn up any errors after being setup, what else can you debug to see why glUseProgram doesn’t start the program?
At the very least you should probably check the link status after linking your program (GetProgramiv with LINK_STATUS), and for good measure a compile status check wouldn’t hurt (GetShaderiv with COMPILE_STATUS).
P.S. Wouldn’t hardcode that array length if I were you! (Look at GetShaderiv/GetProgramiv with INFO_LOG_LENGTH.)
If shader is a shader object, the returned info log will either be an empty string
or it will contain information about the last compilation attempt for that object. If
program is a program object, the returned info log will either be an empty string or
it will contain information about the last link attempt or last validation attempt for
that object.
The info log is typically only useful during application development and an
application should not expect different GL implementations to produce identical
info logs.
Each program object has an information log that is overwritten as a result of a
link operation. This information log can be queried with GetProgramInfoLog to
obtain more information about the link operation or the validation information.
So error information isn’t strictly required to be written to the logs (though in practice it usually is).
glslDevil is quite nice. i use RenderMonkey once in a while because it supports GLSL, compiling and checking shaders right away and has a somewhat pretty interface. Pretty good tool for developing and testing shaders.