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;
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()) {
GraphicsContext::Traits* traits
= new GraphicsContext::Traits(*defaultTraits);
traits->windowName = "FlightGear";
+
GraphicsContext* gc = GraphicsContext::createGraphicsContext(traits);
if (gc) {
defaultWindow = WindowSystemAdapter::getWSA()
->registerWindow(gc, defaultWindowName);
return defaultWindow;
} else {
+ SG_LOG(SG_GENERAL, SG_ALERT, "getDefaultWindow: failed to create GraphicsContext");
return 0;
}
}