]> git.mxchange.org Git - flightgear.git/commitdiff
Default the screen and display number to a value >= 0
authorMathias Froehlich <Mathias.Froehlich@web.de>
Mon, 14 Jun 2010 20:05:15 +0000 (22:05 +0200)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Mon, 14 Jun 2010 20:05:15 +0000 (22:05 +0200)
src/Main/WindowBuilder.cxx

index 79fff968f98a1b9ccd04b536218cf1dc7ba0ccec..d1c90618f3a25c7d66e9d34e87c355f4eff73df1 100644 (file)
@@ -60,6 +60,10 @@ WindowBuilder::makeDefaultTraits(bool stencil)
 
     GraphicsContext::Traits* traits = new osg::GraphicsContext::Traits;
     traits->readDISPLAY();
+    if (traits->displayNum < 0)
+        traits->displayNum = 0;
+    if (traits->screenNum < 0)
+        traits->screenNum = 0;
     int cbits = (bpp <= 16) ?  5 :  8;
     int zbits = (bpp <= 16) ? 16 : 24;
     traits->red = traits->green = traits->blue = cbits;
@@ -148,7 +152,7 @@ GraphicsWindow* WindowBuilder::buildWindow(const SGPropertyNode* winNode)
     string windowName;
     if (winNode->hasChild("window-name"))
         windowName = winNode->getStringValue("window-name");
-    else if (winNode->hasChild("name")) 
+    else if (winNode->hasChild("name"))
         windowName = winNode->getStringValue("name");
     GraphicsWindow* result = 0;
     if (!windowName.empty()) {