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()之前。

posted @ 2018-10-19 17:51  Mouming_Ning  阅读(1901)  评论(0编辑  收藏  举报