Re: [gtk-list] Re: X and idles => incredible slowdowns



Deborah Swayne wrote:
> 
> On Wed, May 03, 2000 at 05:51:05PM -0700, Timothy M. Shead wrote:
> > As an additional suggestion:
> >
> > Using a timeout function only works well if you can guarantee that your
> > drawing time is less than the duration between timeout events.  If not, GTK+
> > doesn't get a chance to handle events generated by the user (such as your
> > checkbox).  I've had good success with setting a timeout event to twice the
> > desired refresh frequency, and only refreshing the display every other
> > timeout - this way, you guarantee a small amount of idle time for GTK+ to
> > handle user interaction.
> 
> Do you have any useful tricks for figuring out how much time the
> timeout event requires?  Mine's not going to be the same from
> minute to minute.  I guess one can set a time stamp when it begins,
> and another when it ends, and remove and add the timeout accordingly.
> Is that what you would do?

In my case, I've never really cared enough to try :)  Typically I'm
drawing with OpenGL at a target rate of 30 fps - so I just set a 60Hz
timeout ... 1/60 = 16msec (or so).  This is hardly scientific, due to
system overhead, but it's Good Enough.

Tim



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]