OSG 改变窗口大小
1 viewer.realize();//需要realize,否则窗口为null 2 osgViewer::GraphicsWindow *pWnd = dynamic_cast<osgViewer::GraphicsWindow*>(viewer.getCamera()->getGraphicsContext()); 3 if (pWnd) { 4 pWnd->setWindowRectangle(20, 20, 600,600); 5 6 pWnd->setWindowDecoration(true); 7 }
在main函数中添加,在viewer.run()之前。