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;

猜你喜欢

转载自www.cnblogs.com/herd/p/11118857.html
今日推荐