home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18127 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.4 KB  |  43 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!jvnc.net!primerd.prime.com!j.cook
  3. From: j.cook@primerd.prime.com (C. James Cook)
  4. Subject: Re: Copybits/Offscreen drawing...
  5. Message-ID: <1992Nov7.142048@primerd.Prime.COM>
  6. Organization: Prime Computer R&D
  7. References: <QeyRNC_00WBMQ9JI8O@andrew.cmu.edu>
  8. Date: Sat, 7 Nov 1992 19:26:51 GMT
  9. Lines: 32
  10.  
  11. "John A. Fedak" <jf3c+@andrew.cmu.edu> writes:
  12. > yo,
  13. > OK I've stared a this long enough, what am I doing wrong?
  14. > It's going to be a simple little animation routine.  I'm attempting
  15. > to draw offscreen to speed things up a little.
  16. ...
  17. >     NewGWorld(&newWorld,0,&mainBounds,0,0,0);
  18. >     newMap = GetGWorldPixMap(newWorld);
  19. >     LockPixels(newMap); 
  20. >     
  21. >  SetGWorld(newWorld,currDevice);
  22. >   /* Draw Stuff Here */
  23. >     CopyBits(newWorld->portPixMap,currPort->portPixMap,
  24. >              &newWorld->portRect  ,&currPort->portRect  ,srcCopy,0);         
  25.  
  26. 1. When you do a SetGWorld where the first argument is a GWorld, the second
  27.    field (the device) should be 0 or NIL.  The NewGWorld already created a
  28.     device for you, you should use it when accessing your GWorld bitmap,
  29.    and unlike "normal" ports, SetGWorld can figure out the GDevice from the
  30.    port with GWorlds, so you supply zero.
  31.  
  32. 2. When you do a CopyBits call, you want the current port to be set to the
  33.    destination as used in the CopyBits call.  It looks like it is set to
  34.    the source (your GWorld).
  35.  
  36. Good luck,
  37. Jim
  38.  
  39.