Added Viewer::setUpViewerAsEmbeddedInWindow convinience method

This commit is contained in:
Robert Osfield
2007-06-03 09:34:28 +00:00
parent 089b9dbd88
commit b5791629ea
4 changed files with 18 additions and 10 deletions

View File

@@ -773,6 +773,15 @@ void Viewer::setSceneData(osg::Node* node)
setUpRenderingSupport();
}
GraphicsWindowEmbedded* Viewer::setUpViewerAsEmbeddedInWindow(int x, int y, int width, int height)
{
setThreadingModel(SingleThreaded);
osgViewer::GraphicsWindowEmbedded* gw = new osgViewer::GraphicsWindowEmbedded(x,y,width,height);
getCamera()->setViewport(new osg::Viewport(0,0,width,height));
getCamera()->setGraphicsContext(gw);
return gw;
}
void Viewer::setThreadingModel(ThreadingModel threadingModel)
{
if (_threadingModel == threadingModel) return;