Hi,
I have a custom drawable that makes calls to some openGL code in the
drawImplementation() method (much like the osgTeapot example).
The code is from a 3rd party vendor and they obviously make calls that
change some openGL attributes because things like the stats handler stop
working after this drawable is added to the scene.
I've fixed the problem by pushing/ poping the openGL attributes like so:
MyDrawable::drawImplementation( osg::RenderInfo& ri) const
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
// do third party drawing code
glPopAttrib();
}
I have two questions. First, is there a way to use osg::state to do
this? Would this work?
MyDrawable::drawImplementation( osg::RenderInfo& ri) const
{
osg::state* state = ri.getState();
state->pushStateSet(getStateSet());
// do third party drawing code
state->popStateSet();
}
Second, if I could figure out what attributes the 3rd party code sets,
would I be better off setting the stateSet of the drawable in the CTOR?
Thanks,
Brett
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org