Hi John,

I had the same problem with DatabasePager, Our problem was that we want
to create and destroy windows and also have more than one paged scenegraph.

I found a solution not passing throught osgDB::Registry but creating a
DatabasePager instance in each window. I know this is really dangerous
becouse
the amount of memory we consume, but is a solution.

If your app doesn't need to create multiple windows you can call some
release methods
in ScenView and DatabasePager, this is our resetGLObjects() method, that we
use when
some occurs with the GL Context.

void Viewer::resetGLObjects()
{
           for(EventHandlerList::iterator hitr = _eventHandlerList.begin();
               hitr != _eventHandlerList.end();
               ++hitr)
           {
               (*hitr)->releaseGLObjects(_sceneView->getState());
           }

           if (_databasePager.valid())
           {
               // clear the database pager so its starts a fresh on the
next update/cull/draw traversals
               _databasePager->clear();
           }

           // release the GL objects stored in the scene graph.
           _sceneView->releaseAllGLObjects();
           _sceneView->flushAllDeletedGLObjects();
           _sceneView->getState()->reset();
}

If you need to create more than one window, then you also need create a
different
contextID for each window viewer.
on version 1.2 was in that way..
unsigned int contextID = osg::GraphicsContext::createNewContextID();
but now.. is better to use osgViewer::SimpleViewer if you
need to integrate with third party windowing toolkit.

Hope this helps to you.
Rafa.





On 3/5/07, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote:

True enough my friend... I understand completely.
I'll find a way though. It'll just take a little time.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Monday, March 05, 2007 11:37 AM
To: osg users
Subject: Re: [osg-users] osgDB::DatabasePager ... Possible to not
getfromosgDB::Registry???

John,

For funky OSG usage like this you need to trawl through the achives and
gleen what you can, this type of usage is possible but well
outside normal OSG usage and what it was designed around.   I have RSI
so can't hand walk anyone though even simple stuff let alone well of the
beaten track stuff like this.

Robert.

On 3/5/07, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote:
> Robert,
>
> My osg app is nested in a DLL as a plugin. When I destroy the last
> instance of it, I can't do a complete cleanup? So that when I create a

> new one and load my .osga file it truly reloads? Can't I somehow
> delete the Registry or DatabasePager? This would really be a great
> help to me if you can think of a way to do it.
>
> Your pal,
> John
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Robert
> Osfield
> Sent: Monday, March 05, 2007 11:07 AM
> To: osg users
> Subject: Re: [osg-users] osgDB::DatabasePager ... Possible to not get
> fromosgDB::Registry???
>
> Hi John,
>
> I don't know enough about your app usage to really suggest very much,
> but typical problems one might encounter with open and closing windows

> is the scene graph holding handles to texture and display lists that
> are no longer valid because your removed the graphics context they are

> associated with.
>
> The new osgViewer library does allow you to create and destroy windows

> on the fly and it'll work to manage the context and display
> lists/texture objects for you so consider using it.
>
> Robert.
>
> On 3/5/07, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Hi All.
> >
> > DatabasePager is giving me some trouble when I destroy a view and
> > then
>
> > create a new view. It seems that something is mixed up, possibly my
> > code. I am trying to allow all views to share graphics context, but
> > when I destroy the document (the parent of all views) and create
> > another, the databasepager won't reload my paged earth and I somehow

> > lose texture on the face that I was viewing in the first instance.
> > My question then is this: Can I create my own database pager without

> > paying heed to osgDB::Registry, or can I completely destroy the
> > osgDB::Registry's instance of database pager? As always, your
> > thoughts
> on this are greatly appreciated.
> >
> > Sincerely,
> > John Argentieri
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to