[osg-users] dynamically adding a view

Can T. Oguz ctoguz at gmail.com
Thu Nov 19 06:02:39 PST 2009


I've got something similar. I'm using CompositeViewer within MFC (OS :
Windows7) and adding/removing views in runtime just like John did. I've met
several issues :

1. After adding and removing several number of views, frame rate drops
significantly even after leaving only one view. This is for single threaded
usage of CompositeViewer; if I use ThreadPerContext, it recovers. This is
not an issue to me, I just wanted you to know.

2. Not any other model, but if I load "avatar.osg" that comes with the
standart OSG dataset, after removing a view and adding a new view, it
crashes in the first frame's render traversal. You can see the call stack
and exact location of crash at the attached screen capture(crash.bmp). I
create one rendering context and one slave camera for each new window
handle. I don't let OSG to create new windows but inherit existing ones
because they are MFC views. And one interesting point is that if I do not
share one loaded model but load separate models for each camera, it doesn't
crash but displays a buggy rendering (buggy_rendering.bmp) In the buggy
rendering case, I think the rendering context handle that was being used by
the previously deleted window is used for the new window (I assume that
because handles were consecutive in the debug window)

Any ideas? Or do I need to do something extra after removing or adding a
view? Sure I don't need to call realize() but something else may be. Or is
it possible that avatar.osg is the problem?



2009/10/26 John Morris <john.e.morris at lmco.com>

> Hi,
> The stopThreading and startThreading methods were exactly what I needed.
>  My code is working great now.
> Thank you!
> John
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=18724#18724
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091119/c2653a3c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: captures.7z
Type: application/octet-stream
Size: 190672 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091119/c2653a3c/attachment-0001.obj>

More information about the osg-users mailing list