Thanks Robert, I was thinking to do something like this (but will look in your pointed direction as well).
osg::State & state = *renderInfo.getState(); osg::ref_ptr< osg::StateSet > stateSet = new osg::StateSet(); state.captureCurrentState( *stateSet ); state.disableAllVertexArrays(); state.dirtyAllVertexArrays(); GL Drawing state.apply(); The GL code usee glew and some (really few) calls for reseting some states, but my intension was not to include glew in the project and have it all osg clean. Thanks again Nick On Tue, Aug 20, 2013 at 3:27 PM, Robert Osfield <[email protected]>wrote: > On 20 August 2013 13:05, Trajce Nikolov NICK < > [email protected]> wrote: > >> lol ;-) ... Come on. I am trying to wrap it with osg code instead of >> OpenGL calls (and forgot many things in between the ages) >> > > There isn't a straight single line call, or answer to your question about > resetting state. > > osg::State has a list of all the current StateSet + Modes in a series of > stacks, a stack for each mode and stack for each stateattribute. Internally > osg::State maintains a global_default_attribute for each of these stacks > and calls this when the stack is newly emptied when the last stateattribute > of that type of popped and the current state applied, the method > osg::State::applyGlobalDefaultAttribute(AtrtributeStack&) does the actual > work so go have a look it it's implementation. The mode stacks also have a > similar global_default_value member variable that tracks what to apply when > all the modes of given type of popped. > > What is missing for you is a convenience method that gets all these > defaults, or applies these. You could write one and submit it for inclusion > in the OSG, or look to create your won StateSet based on these global > defaults embedded in osg::State. > > Alternatively just apply the StateSet to make sure the modes and > attributes you care about are set to a value that your OpenGL code requires > - this is normally what one does in this instance. > > Robert. > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- trajce nikolov nick
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

