Hi Bob,

The answer is in the source ;-)

Viewer::run() is bascially equivilant to:

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

And frame itself is bascially just a call to advance(),
eventTraversal(), updateTraversal() and renderTraversals() so can be
rewritten long hand:

  while(viewer.done())
  {
    viewer.advance();
    viewer.eventTraversal();
    viewer.updateTraversal();
    viewer.renderingTraversal();
  }

There is no delays adding it to control frame rate, this left entirely
up to the OpenGL fifo, which in the end is blocked by vysnc, the loop
doesn't switch off until done is called.  If you write the frame loop
yourself as above they you can insert a block/sleep anyhow you want.
Don't forget Viewer::run() and Viewer::frame() are just convenience
methods, nothing more.

Robert.

In you own app what you need to do is write you own run method and add
in an optional sleep method into the above loop:

On Nov 17, 2007 10:38 PM, Robert Balfour <[EMAIL PROTECTED]> wrote:
> Robert Osfield wrote:
> >
> > As for window minimization issues, this is something that is windowing
> > dependent.  I don't recall having done any work personally on
> > explicitly handling window minimization, the app should be getting the
> > events though so an event handler in the view could probably be used
> > to switch off the rendering frame loop while the window is minimized.
> >
>
> I have an event handler recognizing window minimization, but w.r.t. the
> rendering frame loop, after osgViewer->run() how does the app control:
>
> 1. the max frame rate (i.e. limiting it to 30Hz or 60Hz)?
>
> 2. pausing/restarting the rendering frame loop?
>
> Thanks.
>
> Bob.
> --
> Robert E. Balfour, Ph.D.
> Exec. V.P. & CTO,  BALFOUR Technologies LLC
> 960 South Broadway, Suite 108, Hicksville NY 11801
> Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED]
> _______________________________________________
> 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