开发者

enable/disable frag & vert shaders

开发者 https://www.devze.com 2023-02-23 16:50 出处:网络
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

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

精彩评论

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

关注公众号