[Fresco-devel] animation

Nick Lewycky <[email protected]>
Newsgroups gmane.comp.video.fresco.devel
Message-ID <[email protected]>
I recently had the occasion to implement a little animated gizmo which 
works by calling need_redraw() as soon as it is done drawing.

This almost works. For as long as the Console is receiving events (such 
as waving the mouse around) the gizmo continues to update. 
Unfortunately, everything freezes unless the Console receives its events.

The main loop in Fresco works like this:
while(1)
   if (haveDamage and atLeastAThirdSecondHasPassed)
     repair
   endif
   blockUntilNextEvent

Unfortunately, what we really want to do is replace 
"blockUntilNextEvent" with "blockUntilEventOrDamage." It just happens to 
be harder to do with the real code than with pseudo-code. :)

If I were to expand that pcode, it'd look like this:
while(1)
   If there's damage already
     let the event manager process all PENDING events, without blocking
   else
     block waiting for either an event or fresh damage
     (remember that damage may occur at any time since an animation may 
be calling need_redraw from a timer)
     if it was an event, process it.
   endif
   repair

Unfortunately, we currently have no way to tell the event manager to 
process only pending events. All we get is "next_event" which in turn 
calls the Console's next_event function which blocks. We need 
non-blocking versions of both of these functions. Yes, that means adding 
them to the Console interface too. (Just when you thought I was done 
with that!)

Does this sound correct to everybody?

Can I have a buddy to do the work on the GGIConsole if I work on the 
SDLConsole and event manager? I'd appreciate it since the GGIConsole 
fails to load at run-time for me.

BTW, if you want a copy of the gizmo, it's on fresco-contrib in 
nicholasl/progress/ .

Thanks,
Nick Lewycky
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.