]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/WindowBuilder.cxx
Merge branch 'attenuation' into navaids-radio
[flightgear.git] / src / Main / WindowBuilder.cxx
index 2ca83cfc63c7ccb106c5bf51528f1da15aecbf30..ceb23b4612ebfcc00a04cdc5d45112b7800d6cdf 100644 (file)
@@ -53,12 +53,8 @@ WindowBuilder::makeDefaultTraits(bool stencil)
     GraphicsContext::WindowingSystemInterface* wsi
         = osg::GraphicsContext::getWindowingSystemInterface();
     GraphicsContext::Traits* traits = new osg::GraphicsContext::Traits;
-    traits->readDISPLAY();
-
-    unsigned screenwidth = 0;
-    unsigned screenheight = 0;
-    wsi->getScreenResolution(*traits, screenwidth, screenheight);
 
+    traits->readDISPLAY();
     if (traits->displayNum < 0)
         traits->displayNum = 0;
     if (traits->screenNum < 0)
@@ -76,6 +72,10 @@ WindowBuilder::makeDefaultTraits(bool stencil)
     if (stencil)
         traits->stencil = 8;
 
+    unsigned screenwidth = 0;
+    unsigned screenheight = 0;
+    wsi->getScreenResolution(*traits, screenwidth, screenheight);
+
     traits->doubleBuffer = true;
     traits->mipMapGeneration = true;
     traits->windowName = "FlightGear";