Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!reed!chaffee From: chaffee@reed.UUCP (Alex Chaffee) Newsgroups: comp.sys.mac.programmer Subject: Re: Animation Message-ID: <16145@reed.UUCP> Date: 26 Feb 91 06:14:06 GMT References: <12151@goofy.Apple.COM> Reply-To: chaffee@reed.UUCP (Alex Chaffee) Organization: Reed College, Portland OR Lines: 41 > Baudoin Raoult tells us how to sync to the vertical retrace on small-screen Mac's: tmp := TickCount; while tmp=Tickcount do { nothing } ; CopyBits(.....) > Lawson English says: [use GetTrapAddress] > Brent Schorsch says: [use the global variable Ticks] > Rick Holzgrafe replies: [it's not safe - Be Compatible!] I jumped into the middle of this thread, so this might have been addressed earlier, but if you're going to try to be compatible, why not go whole hog and be able to work on Mac II's? Using SlotVInstall, you can set up a VBL task which is synched to the monitor, regardless of phase or refresh rate. Then this VBL task will increment a global - call it vCount - every single screen refresh. Then you can use vCount just like you use Ticks was in the original code fragment. If you like, I can send (or post) source code that does just this. By the way, I don't always align my right margins; it just seemed to work out that way this time. /* beginning of program */ SlotVInstall(...) ... /* middle */ tmp = vCount; while(tmp==vCount) ; CopyBits(...) ... /* end of program */ SlotVRemove(...) -- Alex Chaffee chaffee@reed.{UUCP,BITNET} Reed College, Portland OR 97202 ____________________