Hi, I have been struggling somewhat to make my screen appear, I have followed the MFC example and managed to get my custom GL screen attached to OSG.
When using viewer->run() my scene appears ok and the camera/view appear to be outside of the cow, but when updating my scene manually using viewer->frame() I end up viewing inside the cow, how do I set my camera or view position when updating the frame manually, does viewer->run() calculate the view of the entire scene automatically? I am slight lost at the moment!!! :) Cheers Martin. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Robert Osfield Sent: 19 February 2010 07:15 To: OpenSceneGraph Users Subject: Re: [osg-users] Viewer and old producer getRenderSurface Hi Martin, RenderSurface and osg::GraphicsContext/osgViewer::GraphicsWindow are kinda equivalent. With osgViewer rather than pack all the platform support into a single class like Producer does it has a series of subclasses, so your get osgViewer::PixelBufferWin32 subclassed from osg::GraphicContext, and osgViewer::GraphicsWindowWin32 subclassed from osgViewer::GraphicsWindow. If you want to get the window handles then you can do it by doing a dynamic_cast<GraphicsWindowWin32> of the Camera::getGraphicsContext() and then getHWND()/getHDC/getWGLContext() or equivalent for X11,Carbon or Cocoa. When setting the inherited window details you will create the graphics context according to a set of osg::GraphicsContext::Traits, which you can pass in the window details. See the examples like osgviewerMFC for a guide. Robert. On Thu, Feb 18, 2010 at 10:54 PM, Martin Naylor <[email protected]> wrote: > Hi all, > > Another stupid quick question: > > What is the equivalent of the old producer call in the latest CVS osg? > > > > viewer.getCamera()-> getRenderSurface()->setWindow(hScrWindow); > > > > I am trying to find it but think i am going around circles.. > > > > Thanks > > > > Martin. > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

