Currently I'm using
glUseProgramObjectARB(ProgramObject);
and
glUseProgramObjectARB(0);
But it doesn't switch back properly,and gives me an “invalid operation glError” along these lines
void updateAnim_withShader()
{
int location;
location = getUniLoc(ProgramObject, "currentTime");
ParticleTime += 0.002f;
if (ParticleTime > 15.0)
ParticleTime = 0.0;
glUniform1fARB(location, ParticleTime);
printOpenGLErr开发者_如何学Cor();
}
What's the proper/right way of doing it(enable/disable shaders)?
[my code files(Temporary link removed )][1]
Your location
is -1, because the actual currentTime
uniform was not used in a shader.
精彩评论