Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!mcsun!ukc!pyrltd!abekrd!ecmwf!ecmwf!mab From: mab@ecmwf.co.uk (Baudoin Raoult) Newsgroups: comp.sys.mac.programmer Subject: Re: Animation Message-ID: <1991Feb7.093610.12594@ecmwf.co.uk> Date: 7 Feb 91 09:36:10 GMT References: <9102030634.AA09598@enuxha.eas.asu.edu> Sender: usenet@ecmwf.co.uk (NEWS deafult user) Reply-To: mab@ecmwf.co.uk (Baudoin Raoult) Organization: ECMWF Lines: 18 In article <9102030634.AA09598@enuxha.eas.asu.edu>, trotter@ENUXHA.EAS.ASU.EDU (Russell T. Trotter) writes: > What is the best way to do animation if I am relying on > the main event loop for the updates for the motion? > > I have tried various combinations of CopyBits(), > PutIcon, DrawPicture(),...etc, but they all > seem to be too flickery. Am I just doing > something fundamentally wrong? > Thanks to all who reply! To avoid flickery animation, you must synchronise your CopyBits with the video spot. The simplest way is to use TickCount, as the tick counter is updated every 60th of second, each time the video spot starts to update new screen. So just write: tmp := TickCount; while tmp=Tickcount do { nothing } ; CopyBits(.....)