Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!umn-d-ub!gandreas From: gandreas@umn-d-ub.D.UMN.EDU (Glenn Andreas) Newsgroups: comp.sys.mac.programmer Subject: Re: Smoothly dragging small pictures Keywords: drag smooth copybits offscreen Message-ID: <1068@umn-d-ub.D.UMN.EDU> Date: 13 May 89 00:13:31 GMT References: <12492910881010@osu-20.ircc.ohio-state.edu> <1065@umn-d-ub.D.UMN.EDU> <1488@murtoa.cs.mu.oz.au> Reply-To: gandreas@ub.d.umn.edu.UUCP (Glenn Andreas) Organization: University of Minnesota, Duluth Lines: 43 In article <1488@murtoa.cs.mu.oz.au> jkjl@munmurra.UUCP (John Lim) writes: >From: jkjl@munnari.oz (John Lim) >Path: munnari.oz!jkjl > >Why not simply do > >do { > doCopyBits(); /* from offscreen to screen BitMap */ > ticker = TickCount(); > while (ticker == TickCount) /* do some background processing */; >} while (ContinueCopyBits); > >The advantage of this method is that you have time to do some >background processing, and you don't waste memory in allocating a >second offscreen BitMap (which looks like a bit of a kludge to me). > > > john lim This won't work based on the original question, since there needs to be a way to erase where you were, restoring the original background. Sure, you can time it for the VBL (which the TickCount wait does), but there are still problems: 1) There will be certain areas on the screen that it doesn't work at all. I tried this, waiting for the TickCount, and quickly restoring the old background and slapping on the new image. It had an interesting effect - there would be a horizontal band where the image would disappear completely. It just took too long to restore the old image and slap up the new one. 2) This won't work on monitors such as are found a II, etc... which do not have a vertical retrace at the same rate as the tick count changes. There are more details in IM V. All in all, a background image bitmap and a temp intermediate bitmap system seems to be the best solution (except for the memory price). =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= = "Whether you like it, or don't like it, sit | - gandreas@ub.d.umn.edu - = = back and take a look at it, because it's the | Glenn Andreas = = best going today! WOOOOoooo!" - Ric Flair | = =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=