Hi Charles, Perhaps the easist way to do the integration would be to pass in the underlying window to GraphicsWindowX11 and let it handle the graphics context and event handling from the window. The but in this is that I haven't yet fully implemented the ability to pass in an external window to GraphicsWidowX11 yet.
The other route is as you've taken is to create a GraphicsWindowXm as per the osgsimpleviewerQT/FLTK etc examples. As for the async error, this will be down to two separate threads working with Xlib without multi-threaded X usage being enabled. Calling XInitThreads() on start up could cure this, but then the better route might well be to work out why multiple threads are active in the first place. Robert. On 3/20/07, Charles Cosse <[EMAIL PROTECTED]> wrote:
Hi OSG Users, Can anyone suggest a good way to get osgViewer stuff to coexist with Motif in a single window? Here is my approach which doesn't work: 1. derive "GraphicsWindowXm" (gw) from osgViewer::GraphicsWindow and OpenThreads::Thread 2. the motif window has a glwDrawingArea (da) for rendering 3. from main, tell the gw to make itself current, etc. 4. create an osgViewer::SimpleViewer (sv) and setSceneData(model) 5. run the GWXm thread 6. enter the while loop: sv->frame(); gw->swapBuffers(); This works fine until i move the window, at which point i get: Xlib: unexpected async reply The window can be resized, maximized, everything execpt moved. The Xlib error is due to two threads referencing the same X connection. I don't know why it only crashes on window move and nothing else. 2 areas which seem like they might be of some use are: osg::GraphicsContext::set/createGraphicsThread() osg::Camera::setRenderTargetImplementation() Another idea is to catch expose events and set a flag which tells the osg-loop to pause while moving the window...but that seems like a bad hack. Any advice on this would be very appreciated. Thank you, -Charlie _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
