【问题标题】:OGRE app does not run properlyOGRE 应用程序无法正常运行
【发布时间】:2014-09-07 11:43:08
【问题描述】:

我正在使用 Qt 和 OGRE 创建一个应用程序。我遵循了本教程:http://www.ogre3d.org/tikiwiki/QtOgre

我在运行应用程序时得到以下输出窗口:

图像显示了背景窗口的剪辑部分。

以下代码在运行时出错:

void THIS::paintGL()
{
// Be sure to call "OgreWidget->repaint();" to call paintGL
swapBuffers();
assert( mOgreWindow );
mOgreRoot->renderOneFrame();
}

错误是:

QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined

我该如何解决这个问题?

【问题讨论】:

    标签: qt ogre


    【解决方案1】:

    我刚刚声明了参数winHandle,并没有定义与之关联的不同参数。

    winHandle = Ogre::StringConverter::toString((unsigned long)(QX11Info::display()));
    winHandle += ":";
    winHandle += Ogre::StringConverter::toString((unsigned int)(QX11Info::appScreen()));
    winHandle += ":";
    winHandle += Ogre::StringConverter::toString((unsigned long)(winId()));
    

    在声明 Ogre::String winHandle; 之后添加上述代码 sn-p 并将其关联到参数,同时定义渲染窗口的创建对我有用。 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-08
      相关资源
      最近更新 更多