On Wed, 18 Aug 2010, Albrecht Schlosser wrote:

> On 18.08.2010, at 12:44, MacArthur, Ian (SELEX GALILEO, UK) wrote:
>>
>>> Would there be any issues to be expected with setting
>>> up a timer callback inside the draw() event? This would
>>> allow the GIF object to 'damage' itself for redrawing
>>> whenever it's time for the next frame to be displayed.
>>
>> I think calling add_timeout (or maybe better repeat_timeout) from within
>> the draw() method would be OK - though I can't recall ever having done
>> it...
>
> I recommend to start the timer once the image is loaded and to call
> repeat_timeout in the timer callback.

The only problem I can see with this is that (if I remember correctly)
each GIF frame can have a different duration. This is easier to
implement by setting up single add_timeouts as needed rather than 
repeat_timeouts, but probably run less efficiently. Also, I suppose
the increment-and-wrap-to-0 could still figure out which frame to
display based on the total time that has passed, so it should not
really be an issue.

Best,
Marc

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to