Hi Robert,
> Thanks for spotting to typo. I hadn't noticed this before, and it hadn't
> been reported either. I am fixing this and will get it checked in once my
> clean build has completed.
My first major contribution to the OSG community ;-)
> As for implementing an off screen viewer functionality using a pbuffer. I
> haven't ever tried this on contemplated it. It should be possible to mimic
> traditional window events by injecting them into the EventQueue, and you've
> spotted passing on the appropriate window size will be required. I can't
> provide any specific advice though as you are already further down the road
> of trying something I haven't done yet :-)
OK, thanks for feedback.
For completeness, you'll also had to override
ViewerBase::checkEvents() if you want to leverage on viewer's
on-demand run scheme. Indeed, the Viewer and CompositeViewer
implementations only check for events from devices and windows. With
an off-screen viewer, you won't get any window, only views for which
you need to take care of setting a graphics contexts as I proposed
previously.
For a CompositeViewer-inherited off-screen viewer, checkEvents() looks like:
bool OffscreenViewer::checkEvents()
{
if (CompositeViewer::checkEvents())
return true;
Views views;
getViews(views);
// Check events from any views
for (Views::iterator vitr = views.begin();
vitr != views.end();
++vitr)
{
if ((*vitr)->getEventQueue() &&
!((*vitr)->getEventQueue()->empty()))
return true;
}
return false;
}
Hope this helps,
Émeric
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org