unsigned int width, height;
//获取系统分辨率
osg::GraphicsContext::WindowingSystemInterface *wsInterface = osg::GraphicsContext::getWindowingSystemInterface();
if (!wsInterface)
{
return;
}
wsInterface->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); osg::ref_ptr<osg::GraphicsContext::Traits> traits1 = new osg::GraphicsContext::Traits; traits1->x = 0; traits1->y = 0; traits1->width = width; traits1->height = height; traits1->windowDecoration = false; traits1->doubleBuffer = true; traits1->sharedContext = 0;