On 5/8/07, 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.
Should it be possible to add a setWindowHandle (or setWindow like in RenderSurface) to facilitate it ? It does not exist yet because anybody has done it or is there another reason ? -- Serge Lages http://www.magrathea-engine.org
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/