[osg-users] event callback after viewer is done

Robert Osfield robert.osfield at gmail.com
Tue Oct 6 11:56:13 PDT 2015


Hi Ricky,

I don't know what is in your event callback but for exit to cause a crash
it sounds like something is probably not being managed robustly.  As I know
so little I can't provide any specific advice.

One possibility might be to call viewer.eventTravseral() after the main
rendering loop.  I can't help be feel there is something amiss in the way
your are managing your event callback and it's associated faculties, and
suspect a small redesign could probably resolve the issue.

Robert.

On 6 October 2015 at 18:03, Riccardo Corsi <riccardo.corsi at kairos3d.it>
wrote:

> Hi all,
>
> I have an event callback which needed to be called before some custom code
> I call in the main application loop, something like:
>
> while()
> {
> viewer.eventTraversal();  // << needed callback here
>
> // custom code
> // prepare stuff to be drawn during next frames
>
> viewer.updateTraversal();
> // ...
> }
>
> When the viewer is about to exit, the event callbacks are not called.
> In my case the callback is needed instead,
> not to cause a segfault to the custom code between osg calls.
>
> The obvious solution is to place the callback directly in the main loop,
> but I'd like to avoid that
> (to keep it more "transparent", as it's a kind of framework to be used in
> several applications).
>
> Have you got any suggestion?
> Thank you!
> Ricky
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151006/e6a0b3a6/attachment-0003.htm>


More information about the osg-users mailing list