Added DisplaySettings support into osgViewer::Viewer

This commit is contained in:
Robert Osfield
2007-01-11 12:06:24 +00:00
parent d6291a0ffc
commit 374f8e30a4
5 changed files with 31 additions and 2 deletions

View File

@@ -71,6 +71,8 @@ void View::setUpViewAcrossAllScreens()
return;
}
osg::DisplaySettings* ds = _displaySettings.valid() ? _displaySettings.get() : osg::DisplaySettings::instance();
double fovy, aspectRatio, zNear, zFar;
_camera->getProjectionMatrixAsPerspective(fovy, aspectRatio, zNear, zFar);
@@ -87,6 +89,8 @@ void View::setUpViewAcrossAllScreens()
traits->y = 0;
traits->width = width;
traits->height = height;
traits->alpha = ds->getMinimumNumAlphaBits();
traits->stencil = ds->getMinimumNumStencilBits();
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
@@ -134,6 +138,8 @@ void View::setUpViewAcrossAllScreens()
traits->y = 0;
traits->width = width;
traits->height = height;
traits->alpha = ds->getMinimumNumAlphaBits();
traits->stencil = ds->getMinimumNumStencilBits();
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
@@ -180,6 +186,8 @@ void View::setUpViewAcrossAllScreens()
traits->y = 0;
traits->width = width;
traits->height = height;
traits->alpha = ds->getMinimumNumAlphaBits();
traits->stencil = ds->getMinimumNumStencilBits();
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
@@ -225,6 +233,8 @@ void View::setUpViewOnSingleScreen(unsigned int screenNum)
return;
}
osg::DisplaySettings* ds = _displaySettings.valid() ? _displaySettings.get() : osg::DisplaySettings::instance();
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(screenNum), width, height);
@@ -233,6 +243,8 @@ void View::setUpViewOnSingleScreen(unsigned int screenNum)
traits->y = 0;
traits->width = width;
traits->height = height;
traits->alpha = ds->getMinimumNumAlphaBits();
traits->stencil = ds->getMinimumNumStencilBits();
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;