-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vizkit3DWidget tries to swapBuffers on non-exposed windows, resulting in message on stderr #48
Comments
That would be nice, i already tried to check isVisible(), but it seems like the main window is unable to complete show(), when frame() is not called (the Graphicscontext coming from QT) |
Find the two changes here: https://github.com/pierrewillenbrockdfki/gui-vizkit3d/tree/fix-calling-frame-on-hidden-window (That was a lot easier than expected, but not even compile tested, lacking qt4) |
I tested it in my envire_visualizer setup (that used vizkit3d directly) and it works. Still needs to be tested in a plain rock gui/vizkit (rock-display, debug drawings) context though. |
This happens when running rock-display_bin, using my qt5 branches. Vizkit3DWidget is only changed in minor ways, so the underlying problem imo also exists using qt4.
rock-display does not show() the Vizkit3DWidget by default, but Vizkit3DWidget still does setup its _timer to start calling osgviz::update(), which goes on to osgviz::WindowManager::frame() and then to osgViewer::CompositeViewer::frame(), and finally calling QOpenGLContext::swapBuffers().
Vizkit3DWidget uses an osgviz::Window that extends osgViewer::CompositeViewer with additional data and functionality. The osgviz::Window is created in a way that automatically registers it with the osgviz::WindowManager and cannot be unregistered and registered again without changing its state.
The actual message is
Backtrace from osgviz::WindowManager::frame()
A simple solution would be to check for isVisible() before the call to osgviz::update(), but that only works for applications that have no other calls to osgviz::update() and a single Vizkit3DWidget(or all Vizkit3DWidget being shown/hidden at the same time). A more involved solution could stop using osgviz::Window and osgviz::WindowManager and include the necessary bits directly(with -20+23 lines changes; i can try to rebase that patch off of my qt5 work on request).
The text was updated successfully, but these errors were encountered: