Hi Brett, There is no OSG call to push/pop the OpenGL state, if your own code modifies the OpenGL state that you'll need to do the push/pop yourself to make sure that the state is the same after as it was when entering your code. In your code example you are missing push/popping client state so perhaps you should add this.
You'll also need to consider what state the OSG leaves OpenGL on entering your code segment. Assigning a StateSet to your custom drawable is a good way of setting various OpenGL state you wish. Also make sure you are inheriting what state you require and not inappropriate state down to your drawable. Also be wary of the vertex array settings that the OSG will have set OpenGL up as, the OSG uses lazy state updating so won't change state that it doesn't need to change, so it could be that some vertex arrays are left on on entering your code. You can check what the current vertex array state is from osg::State's access methods - go browse through include/osg/State to see the range of methods open to you. Robert. On Wed, Aug 27, 2008 at 3:37 PM, brettwiesner <[EMAIL PROTECTED]> wrote: > Hi, > > I've got a third party product that does a bunch of openGL stuff inside the > drawImplementation of a custom drawable. The third party stuff I use seems > to leak state (it changes a bunch of indeterminable stuff in openGL) and > that's causing weirdness with the rendering of the rest of my scene > (textures turn blueish for example). > > I'd like to save the entire openGL state machine before the third party > touches openGL, then restore it after. I'm doing the following but it's not > quite working for me. > > glPushAttrib(GL_ALL_ATTRIB_BITS); > > .... do open gl stuff.... > > glPopAttrib(); > Is there an OSG call to make to do this? Perhaps other openGL calls? > > Thanks, > Brett > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

