DrawThreadPerContext CompositeViewer hangs when adding/removing views during runtime... #1822
-
I have a test case based off the osgearth_windows.exe application where I'm using CompositeViewer to create and remove views during runtime. When running the viewer with the single-threaded model, I am able to add a new view during runtime. However, when I switch to a threading model such as DrawThreadPerContext, the viewer hangs on the viewer.frame() call. Each view has a separate GC. The application reports the following errors... **Windows Error #6: [Screen #1] GraphicsWindowWin32::makeCurrentImplementation() - Unable to set current OpenGL rendering context. Reason: The handle is invalid Error: [Screen #1] GraphicsWindowWin32::makeCurrentImplementation() - Window not realized; cannot do makeCurrent.** Is it illegal to run different threading models other than single-threaded with CompositeViewer running views in separate windows and graphics contexts? Is there something else I need to do to run CompositeViewer with different threading models? Perhaps this is more of an OSG question rather than an osgEarth question... For the record, I see the same hang in the osgearth_windows.exe application when I change the threading model from single-threaded to DrawThreadPerContext. Any input would be appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a topic that has vexed many users, myself included. I must admit that even with our many years of experience with OpenSceneGraph, the handling of multiple windows and multiple graphics contexts, and especially opening and closing them at runtime, is still an area that causes trouble. I do encourage you to ask about it on the OSG mailing list (https://groups.google.com/g/osg-users) and to provide a simple .cpp for others (Robert) to use as a testbed. |
Beta Was this translation helpful? Give feedback.
This is a topic that has vexed many users, myself included. I must admit that even with our many years of experience with OpenSceneGraph, the handling of multiple windows and multiple graphics contexts, and especially opening and closing them at runtime, is still an area that causes trouble. I do encourage you to ask about it on the OSG mailing list (https://groups.google.com/g/osg-users) and to provide a simple .cpp for others (Robert) to use as a testbed.
osgearth_windows
was an initial attempt at this, but we did not have the resources to pursue it very far.