Hi,
I'm trying to do the same... but I only get errors... The steps that I follow
are the next:
I create a class OSGQtRenderThreadManager: public OpenThreads::Thread which
contains a variable class ViewerQT : public osgViewer::Viewer, public
AdapterWidget (class AdapterWidget : public QGLWidget).
In the qt application thread I initialize the renderThreadManager and I insert
the QGLWidget variable in a layout:
Code:
_viewerThreadManager = new osgGenerals::OSGQtRenderThreadManager(center, eye,
up, false);
_viewerThreadManager->startThread();
ui.OSGRenderLayout->addWidget(_viewerThreadManager->getQtViewerWidget());
This is de run() of the renderThread:
Code:
void OSGQtRenderThreadManager::run()
{
_done = false;
osg::notify(osg::INFO)<<" Start OSGRender Thread!"<<std::endl;
while(!_done)
{
YieldCurrentThread();
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
_qtViewer->frame();
}
osg::notify(osg::INFO)<<" End OSGRender Thread!"<<std::endl;
}
I suppose that the problem is in the _qtViewer variable acces from the
application main thread and renderThread... But I dont know how can I fix it.
Can someone help me?! Thank you!
Cheers,
Aitor
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46490#46490
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org