Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!masscomp!think.com!mck-csc! From: pete@csc-sun.mckinsey.com (Peter Gaston) Newsgroups: comp.sys.mac.programmer Subject: Re: Can the Mac actually do animation? Message-ID: Date: 5 Apr 91 15:35:41 GMT References: <6205@cactus.org> <2966@cod.NOSC.MIL> <314@crucible.UUCP> Sender: @mck-csc.mckinsey.com Followup-To: comp.sys.mac.programmer Distribution: usa Organization: McKinsey & Co., Inc., Cambridge, MA Lines: 49 In-reply-to: al@crucible.UUCP's message of 4 Apr 91 16:05:00 GMT In article <2966@cod.NOSC.MIL> page@cod.NOSC.MIL (Ward C. Page) writes: >>flicker caused by rewriting the screen a couple times per frame. If you >>can't draw during the retrace then your not really doing animation. Your >>just flailing away at the screen. Control of the update rate is In article <6205@cactus.org> <2966@cod.NOSC.MIL> al@crucible.UUCP (Al Evans) >Sorry, Ward, but you're simply looking at it wrong. Vertical blanking is >completely irrelevant to Mac animation when it's done properly. In this >context, "properly" means "using offscreen bitmaps." The process is fairly >simple: 1) construct the relevent area of background in an offscreen >bitmap, including the part that lies under the current screen image; >2) draw the new image into this bitmap; 3) Copybits the bitmap to the >screen at a time of your choosing, erasing the old image and drawing the >new one simultaneously. No flicker. Naturally, the procedure gets a bit >more elaborate if animated images can overlap, but the approach remains >the same. I beg to differ. I, for example have two video games that you can buy at Toys-r-us if you really want. In that world, video sync is king. Yes, you can decouple game logic from display logic, but you still have to worry about keeping a consistent update rate. For the record, both of the games I worked on updated the screen every other refresh, i.e., 30x/sec. I've experimented on getting good animation on the Mac, but from looking at the games out there, I'm certainly no expert. I do have code that I developed that can display a double-buffered bitmap: - of size - 352 across - 350 down - B&W or 4 color (This is pushing the limits, memory bandwidth wise, as far as my experimentation could determine.) - on 'both' machine families, no slot, slotted (I haven't designed in for the video card with the QD processor yet.) - allowing vertical scrolling - displaying the cursor on top of the bitmap - with no flicker Tricks: - ignore copybits - as you might have guessed - understand video drawing, i.e., when to draw what Unfortunately, there's not enough time in this world to finish my game idea (multi-player, real-time football). oh well... peter gaston