大佬教程收集整理的这篇文章主要介绍了VC3DGraphicsWindowQt,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_772_5@
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 (!@H_728_8@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所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。