osg::GraphicsContext::WindowingSystemInterface Screen Resolution(屏幕分辨率)

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;

 

posted @ 2019-07-02 10:12  西北逍遥  阅读(799)  评论(0编辑  收藏  举报