VC3DGraphicsWindowQt::VC3DGraphicsWindowQt(QWidget* parent,Qt::WindowFlags f){ osg::displaySettings* ds = osg::displaySettings::instance().get(); osg::setNotifyLevel(osg::NotifySeverity::FATAL); _traits = new osg::GraphicsContext::Traits(); _traits->windowdecoration = false; _traits->x = 0; _traits->y = 0; _traits->wIDth = 100; _traits->height = 100; _traits->doubleBuffer = true; if (ds) { _traits->Alpha = ds->getMinimumNumAlphaBits(); _traits->stencil = ds->getMinimumNumStencilBits(); _traits->sampleBuffers = ds->getMultiSamples(); _traits->samples = ds->getNumMultiSamples(); } if (parent) { _traits->wIDth = parent->wIDth(); _traits->height = parent->height(); } // create Widget if it does not exist if (!m_opengl_Widget) { // WindowFlags Qt::WindowFlags flags = f | Qt::Widget; // create Widget m_opengl_Widget = new VC3DQtOSGWidget(parent,flags); } m_opengl_Widget->setMouseTracking(true); m_opengl_Widget->setFocusPolicy(Qt::WheelFocus); m_opengl_Widget->setGraphicsWindow(this); useCursor(_traits->useCursor); // initialize State setState(new osg::State); getState()->setGraphicsContext(this); // initialize contextID if (_traits.valID() && _traits->sharedContext.valID()) { getState()->setContextID(_traits->sharedContext->getState()->getContextID()); incrementContextIDUsageCount(getState()->getContextID()); } else { getState()->setContextID(osg::GraphicsContext::createNewContextID()); } // make sure the event queue has the correct window rectangle size and input range#if (OPENSCENEGRAPH_MAJOR_VERSION == 3) && (OPENSCENEGRAPH_MInor_VERSION == 2) getEventQueue()->syncWindowRectangleWithGraphcisContext();#else getEventQueue()->syncWindowRectangleWithGraphicsContext();#endif}
总结
以上是内存溢出为你收集整理的VC3DGraphicsWindowQt全部内容,希望文章能够帮你解决VC3DGraphicsWindowQt所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)