An animation DLL has a privileged status in that it performs drawing from within the window server thread. This makes continuous updating of graphics possible, since the window server thread has high priority and is unlikely to be pre-empted by other threads. This could be used for example to make a clock second hand sweep smoothly, and might even be exploited for video-style animations although its intended use is for drawn rather than bitmap graphics.
Animation effects could be achieved wholly on the client-side, perhaps using a timer-based active object to trigger updates. But a server-side DLL has several advantages:
it runs in the window server thread, and so is at higher priority than all other application threads
it minimizes context switches when redrawing
it may pre-empt the currently-running application: a client-side active object, even if it had very high priority, would only be scheduled non-pre-emptively and so would often be held up behind other application processing
the timers available are specifically designed for clocks, using ordinary timers will give rise to a drift effect where the clock will slowly loose time
The animation framework requires implementers to write server side and client side code. The Window Server Client Side API provides the client side, RAnimDll
and RAnim
classes. For a more detailed discussion, see the Animation API guide.