Calling reset() on the State works, thanks!

We'll be looking forward to 1.3 for the context work, since we have some
strange things where we've got a couple of different windows open.
What's the current guess for 1.3 availability?

thanks,
andy


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Wednesday, December 13, 2006 3:59 AM
To: osg users
Subject: Re: [osg-users] problem with state as I'm switching windows

Hi Andy,

How are you managing the rendering of the OSG?  Use SceneView
integrated into your app?  Or use osgProducer?

If you are using SceneView are you reusing the same SceneView for each
context?  If so the osg::State object which takes OpenGL state for the
previous graphics context won't be in valid state for a fresh graphics
context.  State::reset() will need to be called to force it to start
afresh.

Also which version of the OSG are you using?  The CVS version has
improved handling of cleaning up and creating new graphics contexts.

Robert.

On 12/12/06, Andy Skinner <[EMAIL PROTECTED]> wrote:
> I'm going to try to explain enough of a pretty large system to see if
> anybody has a suggestion to help us out.
>
> We're switching windows for our OpenSceneGraph tree.  When we remove
the
> window we're drawing in, we call releaseAllGLObjects and
> flushAllDeletedGLObjects().  (I don't know if those are relevant to
the
> problem, but we're trying to let it know that the context is being
> regenerated.)  We do think we're getting a new context.
>
> But we seem to have some state wrong in our new window.  (This usually
> happens after the first time we move our window, but seems to be OK
> after that.)  We're looking at glIsEnabled(GL_DEPTH_TEST) in a
> drawImplementation() call for our quads, and it switches from on to
off
> when we do the reparent.  But the mode in the state still thinks it is
> on.
>
> How might the OpenGL mode be diverging from the OSG mode?  We wondered
> whether OSG was setting the depth test to on and never set it again
> (assuming it hadn't changed), but OpenGL has a new value as we switch
> windows and contexts.  But we tried asking OpenGL before we start
> culling or drawing, and it always says the depth test is off.
>
> If you want to move an OSG scene graph to another context, are there
> calls (other than the ones I do above) that you'd want to do in order
to
> tell it to reset everything?
>
> I know this is sketchy info, but the system is pretty big, and
hopefully
> this will spark an idea that will get us started.
>
> Thanks,
> andy
> The MathWorks
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to