viewer->realize();//需要realize,否则窗口为null osgViewer::GraphicsWindow *pWnd = dynamic_cast<osgViewer::GraphicsWindow*> (viewer->getCamera()->getGraphicsContext()); if (pWnd) { pWnd->setWindowRectangle(20, 20, 600,600); pWnd->setWindowDecoration(true); } viewer->run();
标签:窗口,600,viewer,pWnd,设置,20,realize,osg From: https://www.cnblogs.com/RedWetPlace/p/17846671.html