Operating System: Archlinux
Render System: Vulkan
The following code works for qt5 and gl3plus backend
Code: Select all
Ogre::String winHandle;
#ifdef WIN32
winHandle += Ogre::StringConverter::toString((unsigned long)(winId()));
#else
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()));
#endif
std::cout << "winHandle: " << winHandle << std::endl;
misc["parentWindowHandle"] = winHandle;
//When using the GL3+ renderer, by default the RenderWindow creation create a GL Context.
//Ogre expect to use only one GL Context, so subsequent window need to use the context of the 1st one.
if(Ogre::Root::getSingleton().getRenderSystem()->getName() == "OpenGL 3+ Rendering Subsystem")
{
//At this point, everything will go bad if this window don't use the same GL context
misc["externalGLContext"] = std::to_string(size_t(wglGetCurrentContext()));
}