This problem has arisen before and is related to the scene graph
reusing the contextID from the previous context in the new context
with the scene graph being flushed of OpenGL objects related to the
original graphics context so the OSG then tries to use these OpenGL
objects in the new context, but of course these objects have really
been deleted so things don't work.
The solution is to flush the GL objects for the context scene graph on
closing of the first context, and the OSG will now do this, so should
just work automatically, but if you detach parts of the scene graph
before closing the context you'll need to flush these parts manually
as the context itself won't know about them unless that are nested
below a Camera that the context has.
This leads to next question, which OSG version are you using? If it
isn't 2.6 then upgrade to 2.6 as there is good chance you problem will
disappear as it does a better job at cleaning up on context closure.
Robert.
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
I managed to solve the problem, thanks a lot for pointing me in the right
direction!
I am using OSG version 2.6, and did see that in the destructor of the
CompositeViewer, there is a call to GraphicsContext::close() which flushes
the objects... But, as you said, I was removing some parts of the scene
graph before closing the context.
Thanks again for your help.
Juan
-----Mensaje original-----
Date: Fri, 26 Sep 2008 09:44:15 +0100
From: "Robert Osfield" <robert....@gmail.com>
Subject: Re: [osg-users] Textures not displaying properly when you
open the OSG window the second t ime arround in a Win32
application
To: "OpenSceneGraph Users" <osg-...@lists.openscenegraph.org>
Message-ID:
<7ffb8e9b0809260144k53a...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1