I am creating a custom Drawable that needs to push a Fragment Shader
into the current rendering state and then, after a single extension
call, subsequently remove this shader from the state.

I have some code I noodled through to make this work, but I feel like
there is probably a better way. It goes something like this:

----------------------------------------

drawImplementaion(RenderInfo& ri) {
        State* state = ri.getState();
        unsigned int contextID = state->getContextID();

        _program.apply(state);

        myExtensions->doMycall();

        GL2Extensions::Get(contextID, true)->glUseProgram(0);

        state->setLastAppliedProgramObject(0);
}

----------------------------------------

Like I said above, this "works", but I feel like there is probably a
cleaner way to achieve what I want. Note that _program is a ref_ptr to a
properly create osg::Program object, since I certainly do NOT want to
recreate all the goodness it provides. :)

Any API advice?

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to