0

I am creating an application using Qt and OGRE. I have followed this tutorial: http://www.ogre3d.org/tikiwiki/QtOgre.

I get the following output window on running the application:

enter image description here

The image shows a clipped portion of the background window.

The following code gives an error during runtime:

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

The error is:

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

How do I solve this issue?

Kamalpreet Grewal
  • 822
  • 1
  • 13
  • 28

1 Answers1

0

I had just declared the parameter winHandle and did not define different parameters associated to it.

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()));

Adding the above code snippet after the declaration Ogre::String winHandle; and associating it to params while defining the creation of Render Window worked for me. :)

Kamalpreet Grewal
  • 822
  • 1
  • 13
  • 28