Multiple Render Windows in Qt application
Posted: Thu Feb 01, 2018 6:20 pm
I'm currently trying to debug a problem with an Ogre 1.10 app using Qt5 and several render widgets. Everything works fine until I'm deleting certain widgets, any subsequent call to create a Renderable on other windows fail on some systems (Apple, Windows and Ubuntu with certain drivers confirmed, other systems run fine).
In short, I get an exception e.g. here:
https://github.com/OGRECave/ogre/blob/0 ... er.cpp#L46
Debugging the problem, I can see that "mBufferId" is really 0, which as far as I can tell will only really happen when the OpenGL context is somehow gone. Apart from whatever Qt does, the code under my control is single-threaded.
- To confirm my suspicion, is there a possibility to ask Ogre whether it currently has a context? I could in principle modify Ogre's code, but I can't get a call such as wglGetCurrentContext() to link properly.
- If the context is really lost, I guess there are some errors in the interplay between Ogre and Qt. Does there exist documentation/best practices on how to make a Qt-Ogre app with widgets and several render windows which can be opened and closed ad libitum? I found some bits of information here and there, but most of it outdated.
In short, I get an exception e.g. here:
https://github.com/OGRECave/ogre/blob/0 ... er.cpp#L46
Debugging the problem, I can see that "mBufferId" is really 0, which as far as I can tell will only really happen when the OpenGL context is somehow gone. Apart from whatever Qt does, the code under my control is single-threaded.
- To confirm my suspicion, is there a possibility to ask Ogre whether it currently has a context? I could in principle modify Ogre's code, but I can't get a call such as wglGetCurrentContext() to link properly.
- If the context is really lost, I guess there are some errors in the interplay between Ogre and Qt. Does there exist documentation/best practices on how to make a Qt-Ogre app with widgets and several render windows which can be opened and closed ad libitum? I found some bits of information here and there, but most of it outdated.