Hi Chris,

Normally one should ever need to worry about constructing or destructing
the DatabasePager, it should happen behinds the scenes managed by
osgViewer.  osgViewer::Scene is used internally by osgViewer to manage one
DatabasePager per scene graph.  The Scene object will be shared
automatically between Views if you assign the same Node pointer hen you
call View::setSceneData.  This sharing is done automatically for you.  When
a Scene object is destructed it's DatabasePager will be destructed if no
other references to it exist.

If you have multiple Views that you should be using CompositeViewer, not
multiple Viewer.

If you are creating and destroying views regularly then you are probably
best to enable/disable them by setting the View's master Camera's NodeMask
to 0x0 and back to 0xffffffff, as this will switch off rendering but keep
the  backend around ready to be re-enabled.


On 11 September 2013 16:13, Chris Stankevitz <chrisstankev...@gmail.com>wrote:

> Glenn,
> Thank you for your reply.
> On Wed, Sep 11, 2013 at 4:22 AM, Glenn Waldron <gwald...@gmail.com> wrote:
> > Are you using multiple Viewers, or are you using multiple Views under a
> > CompositeViewer?
> I am experimenting with both of these techniques.  When I use the
> CompositeViewer my views turn "purple" after a couple iterations of
> adding/removing views.
> > I'm not sure running 2 Viewers that point at the same graph
> > is entirely safe.
> This is very interesting to me and I am happy you mentioned it.
> Oddly, I get strange results when using the "safe" approach.  But the
> strange results may have to do with me adding/removing views at
> runtime.
> I wonder if my strange results is because:
> a) I run my viewers single threaded
> b) I add/remove views while not calling Viewer::frame
> c) I thought I was being thread-safe
> d) low and behold it turns out that a databasePager thread is started
> and stopped by someone (i don't know who) at some times (I do not know
> when)  which might be conflicting with (b).
> All this is leading me to ask questions about the DatabasePager:
> When is the DatabasePager created?
> When is the DatabasePager destroyed?
> Is the DatabasePager attached to a view or a graph?
> Is adding and removing many/all views at runtime thread-safe with
> respect to the DatabasePager?
> Thank you again,
> Chris
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
osg-users mailing list

Reply via email to