Path: utzoo!utgpu!attcan!uunet!lll-winken!ames!killer!radar!buffington From: buffington@radar.UUCP (Jon Buffington) Newsgroups: comp.sys.mac.programmer Subject: Re: Fast image changes Message-ID: <158@radar.UUCP> Date: 25 Jan 89 15:42:14 GMT References: <2350@ilium.cs.swarthmore.edu> Organization: CDS Consulting and MacInterested, Nashville, TN Lines: 51 From article <2350@ilium.cs.swarthmore.edu>, by jackiw@cs.swarthmore.edu (Nick Jackiw): > In article <1453@ditsyda.oz> vincent@ditsyda.oz (David A. Vincent) writes: >> in article <243@usage.csd.unsw.oz>, grants@usage.csd.unsw.oz (Grant Sayer) says: >> > I am trying to draw two images one on an offscreen pixelmap and then >> [...] >> >code which swaps the images, basically a copybits operation, into the VBL >> >task queue seem a viable solution. If this is the casethen is it true >> >> This seems viable provided that the copybits can be completed during >> the VBL period. >> > > Much easier is just to coordinate your copyBits with the VBL interval. > You can do this in Pascal by waiting for the system timer to tick, something > which happens as a system-VBL task. > > var x:longint; > > Delay(1,X); {Wait for next VBL interval} > Copybits(...); {Here we go, do it fast!} > > Follow-ups to comp.sys.mac.programmer ONLY. Eradicate cross-posts! Your above advice (using tickcount to synch the raster) is sound only if your monitor is running at 60Hz. Since the person was inteerested in pixmaps, I would think they are using Apple's MAc II monitors which runn near 67Hz. In this case you have to use SlotVInstall() and assoc. routines to create a goAhead Boolean which you should check before CopyBits() in the main code. ex: pushScreen(bMapPtr, src, dest) BitMap *bMapPtr; Rect *src, *dest; { extern Boolean goAhead; /* this is modified in the VTask routine */ goAhead = FALSE; while (!goAhead) ; /* wait for task to signal retrace interupt */ CopyBits(...); } Helpful? Hope so... ------------------- jcb Q Q P eexxex: pushImage2Scree