Greg Ercolano wrote:
> Michael Surette wrote:
>> In my test case there are 53 unevenly timed iterations which take a
>> total of about two seconds and I see three distinct screen updates. If
>> I put in Fl::wait() instead and move the mouse over the screen, I notice
>> more updates in roughly the same time.
>>
>> I'll have to play with this a bit more to find the setup I like best.
>> Any more comments or suggestions would be welcome.
>
> If you need smooth motion during a choppy algorithm,
> you're only other choice I think is to run your
> while() loop in an entirely separate thread, so that FLTK
> has the main thread all to itself, and remove the Fl::check()
> call from your loop.
Running a keep-alive timer at 5ms while my loop is running with
Fl::wait() has given me the effect I'm looking for with no noticeable
slowdown.
void keepAlive_to(void *)
{
Fl::repeat_timeout(0.005,keepAlive_to);
}
...
Fl::add_timeout(0.005,keepAlive_to);
while ( doSomething() )
Fl::wait();
Fl::remove_timeout(keepAlive_to);
Since this is a learning exercise, I'll have to try your idea too.
Thanks again.
Mike
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk