开发者

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);
    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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜