Hi Nick,

void Drawable::drawImplementation(osg::RenderInfo& renderInfo) const
{
    osg::ref_ptr<osg::StateSet> standard_state(new osg::StateSet);
    renderInfo.getState()->pushStateSet(standard_state);
    perform CustomRendering();
    renderInfo.getState()->popStateSet(standard_state);
}

This will replace the state with the default state.
I guess you can get the current state from the renderInfo as well.

cheers
Sebastian
Hi Community,

I have a custom rendering with GL calls and I want to wrap them in push/pop StateSet (and everything). I see in osg::State all the push/pop (like pushUniformList) methods are not accessible. Any hint how to do this?

Here is what is something like I need:
void Drawable::drawImplementation(osg::RenderInfo& renderInfo) const
{
      pushEverything()
      doCustomGLRendering();
      popEverything()
}

Thanks a bunch!

Nick


--
trajce nikolov nick


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to