Mzq
Mzq

Reputation: 1854

enable/disable frag & vert shaders

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);
    printOpenGLError();
}

What's the proper/right way of doing it(enable/disable shaders)?

[my code files(Temporary link removed )][1]

Upvotes: 1

Views: 2071

Answers (1)

kvark
kvark

Reputation: 5351

Your location is -1, because the actual currentTime uniform was not used in a shader.

Upvotes: 1

Related Questions