Hi Harash,
Once the view is running its threads it isn't appropriate to
dynamically add a new View, so what you need to do is call
viewer.stopThreading(), add the view then call startThreading().
There is one proviso though, I haven't actually tried this with
CompositeViewer yet, is still a pretty new class. If it doesn't work
we'll need to modify the osgmultiplecameras example to do dynamic
addition/removal of Views, then I can pick up the case at my end and
tweak things so they work, be it modifications to the example or
perhaps to the CompositeViewer implementation itself.
Robert.
On 5/10/07, Harash Sharma <[EMAIL PROTECTED]> wrote:
Hi Robert,
Moving on the lines you had suggested, I have now been able to get a
working MFC MDI Application with osgViewer::CompositeViewer. But there is an
observation on this issue. The application I am developing requires a window
to be dynamically opened / closed. The CompositeViewer class is expecting
all the Views to be added before a call to frame() is made. If I make a call
to osgViewer::CompositeViewer::frame(), then add a view
using osgViewer::CompositeViewer::addView(), and again call
frame(), the program hangs. Debugging, I found that this happens in
osgViewer::renderingTraversal()
....
if ( _startRenderingBarrier.valid())
_startRenderingBarrier->block();
The debugger gives the message: "This process seems to be deadlocked".
I don't know if it is a bug or if the class is not supposed to be used
in this manner. Please Help.
Thanks in Advance.
Regards
Harash.
Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi Harash,
On 5/8/07, Harash Sharma <[EMAIL PROTECTED]> wrote:
As you had suggested, I tried creating the osgViewer::CompositeViewer
object and to it attached the osgViewer::View. Further, as shown in
osgMultipleCameras example, the traits structure was filled accordingly. The
problem I am now facing is how to attach the MFC Window to the
GraphicsContext / osgViewer. OSGMFC achieved this by passing the window
handle using GetSafeHwnd() to Producer::RenderSurface. But I could not
locate a mechanism of passing any such information to the osgViewer::View or
CompositeViewer or Viewer. One Win32WindowingSystemInterface class I could
locate, but there too I could not find a way out.
I don't have the code to hand, but if your browse through the osg-users
email archives for the last week you'll see how to use the
osg::GraphicsContext::Traits::inheritedWindowData set to
osgViewer::GraphicsWindowWin32::WindowData(hwnd) to tell
the viewer to realize a window adopting the passed in window. The approach
is roughly the same as done in Producer::RenderSurface previous, only the
architecture is a bit different in osgViewer.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
________________________________
Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
________________________________
Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail
Beta._______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
_______________________________________________
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/