Fixed fullscreen toggle in ViewerEventHandler that assumed the first

RenderSurface was a window (not a pbuffer).
This commit is contained in:
Don BURNS
2005-05-18 21:45:30 +00:00
parent 0f164c9f7f
commit 702944b67a

View File

@@ -812,12 +812,19 @@ bool ViewerEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
Producer::CameraConfig* cfg = _cg->getCameraConfig();
bool shouldBeFullScreen = false;
bool flag = true;
for( unsigned int i = 0; i < cfg->getNumberOfCameras(); ++i )
{
Producer::Camera *cam = cfg->getCamera(i);
Producer::RenderSurface* rs = cam->getRenderSurface();
if( rs->getDrawableType() != Producer::RenderSurface::DrawableType_Window )
continue;
if(i==0) shouldBeFullScreen =! rs->isFullScreen(); // Remember the initial state of the first render surface
if( flag )
{
shouldBeFullScreen =! rs->isFullScreen(); // Remember the initial state of the first render surface
flag = false;
}
if ( shouldBeFullScreen!=rs->isFullScreen() ) // If the current render surface hasn't been modified already
{