From ba575396a455abdc7bbb282bb8e8fba31715dddb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 17 Apr 2003 15:57:05 +0000 Subject: [PATCH] Added setting of the RenderSurface name to the application name. --- examples/osgwindows/osgwindows.cpp | 2 ++ src/osgProducer/OsgCameraGroup.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/examples/osgwindows/osgwindows.cpp b/examples/osgwindows/osgwindows.cpp index e05f0b909..7cd4d1f81 100644 --- a/examples/osgwindows/osgwindows.cpp +++ b/examples/osgwindows/osgwindows.cpp @@ -17,6 +17,7 @@ static Producer::CameraConfig *BuildConfig(void) { Producer::RenderSurface *rs1 = new Producer::RenderSurface; rs1->setScreenNum(0); + rs1->setWindowName("osgwindows"); //rs1->useBorder(false); rs1->setWindowRectangle(0,0,640,480); Producer::Camera *camera1 = new Producer::Camera; @@ -25,6 +26,7 @@ static Producer::CameraConfig *BuildConfig(void) Producer::RenderSurface *rs2 = new Producer::RenderSurface; rs2->setScreenNum(0); + rs2->setWindowName("osgwindows"); //rs2->useBorder(false); rs2->setWindowRectangle(640,0,640,480); Producer::Camera *camera2 = new Producer::Camera; diff --git a/src/osgProducer/OsgCameraGroup.cpp b/src/osgProducer/OsgCameraGroup.cpp index 99a9cf81d..4ead79ee9 100644 --- a/src/osgProducer/OsgCameraGroup.cpp +++ b/src/osgProducer/OsgCameraGroup.cpp @@ -110,6 +110,16 @@ OsgCameraGroup::OsgCameraGroup(osg::ArgumentParser& arguments): { _init(); _applicationUsage = arguments.getApplicationUsage(); + + for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ ) + { + Producer::Camera *cam = _cfg->getCamera(i); + Producer::RenderSurface *rs = cam->getRenderSurface(); + if (rs->getWindowName()==" *** RenderSurface *** ") + { + rs->setWindowName(arguments.getApplicationName()); + } + } } void OsgCameraGroup::_init()