Hi Torben,

There isn't a pre callback, and there really isn't any need as you
have complete control over the frame loop - and you can subclass from
osgViewer::Viewer/CompositeViewer and override the various
*Traversal() methods.  Personally I'd just expand the frame loop to
look like:

while(!viewer.done())
{
    do_my_custom_pre_frame_work();
    viewer.frame();
}

Or expand frame() further:

while(!viewer.done())
{
    do_my_custom_pre_frame_work();
    viewer.advance();

    do_my_before_event_work();
    viewer.eventTraversal();

    do_my_before_update_work();
    viewer.updateTraversal();

    do_my_before_rendering_work();
    viewer.renderingTraversals();
}


Robert.

On Mon, Aug 16, 2010 at 12:37 PM, Torben Dannhauer
<[email protected]> wrote:
> Hi,
>
> Does OSG provide a Callback ("preFrame callback") which is called at the 
> beginning of each frame, prior to the event callback or any osg calculation?
>
> Of course I could place my preFrame calls in the main rendering loop prior to 
> any traversal, but it would be more clear to use such a callback, otherwise 
> the mainloop would be polluted by code for several modules which are not 
> loaded in all configurations.
>
> Thank you!
>
> Cheers,
> Torben
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=30771#30771
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to