|
最近在做多视图,把多视图和系统的m_Traits和m_Viewer一起初始化,并且隐藏掉,需要的时候再调用出来。
请问这样子视图在隐藏的时候会占用很多系统资源吗?我是否需要在需要打开子视图的时候再进行初始化?
//初始化后视图
backViewer = new osg::Camera;
backViewer->setGraphicsContext(gc);
backViewer->setViewport(new osg::Viewport(0,0, m_Traits ->width/4, m_Traits->height/5));
GLenum bufferback = m_Traits->doubleBuffer ? GL_BACK : GL_FRONT;
backViewer->setDrawBuffer(bufferback);
backViewer->setReadBuffer(bufferback);
//backViewer->setProjectionMatrix(osg::Matrixd::scale(-10.0f,1.0f,1.0f));
m_Viewer->addSlave(backViewer.get(), osg::Matrixd(), osg::Matrixd::rotate(osg::inDegrees(-180.0f), 1.0,0.0,0.0));
backViewer ->setNodeMask(0) ; |
|