home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15391 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.8 KB  |  48 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!utcsri!geac!alias!news
  3. From: Reid Ellis <rae@Alias.com>
  4. Subject: LockPixels() before every CopyBits()?
  5. Message-ID: <1992Sep11.213220.23039@alias.com>
  6. Sender: news@alias.com (News Owner)
  7. Organization: Alias Research, Inc., Toronto ON Canada
  8. Date: Fri, 11 Sep 1992 21:32:20 GMT
  9. Lines: 37
  10.  
  11. Inside Mac V says that LockPixels() must be called before drawing into
  12. an offscreen GWorld.  And yet the examples within the next few pages
  13. don't call LockPixels()!  What's the scoop here?
  14.  
  15. I think I've tracked down a bug in our program where it crashes on a
  16. Quadra 700 but not on a IIci during a call to CopyBits().  On the
  17. Quadra, the baseAddr of one of the bitmaps was F9001000, which was way
  18. out of line with other addresses.  I would guess it's either invalid
  19. or the address of the built-in VRAM.  I can't find any doc that says
  20. "The 32-bit address of the Quadra's VRAM is xxxx".
  21.  
  22. Assuming that the address is okay, I noticed that we don't call
  23. LockPixels() before CopyBits().  After inserting calls to LockPixels()
  24. and UnlockPixels(), it looks something like this:
  25.  
  26.     HLock((Handle) pixHandle1);
  27.     HLock((Handle) pixHandle2);
  28.     LockPixels(pixHandle1);
  29.     LockPixels(pixHandle2);
  30.     CopyBits((BitMap *)*pixHandle1, (BitMap *)*pixHandle2, ...);
  31.     UnlockPixels(pixHandle2);
  32.     UnlockPixels(pixHandle1);
  33.     HUnlock((Handle) pixHandle2);
  34.     HUnlock((Handle) pixHandle1);
  35.  
  36. Now this seems to be a bit much for every call to CopyBits.  Is this
  37. trip really necessary?  Would it be quicker to check to see is each
  38. PixMapHandle is offscreen?
  39.  
  40. I'm off now to try it out.  I'm kind of hoping the address is just
  41. invalid and not in VRAM :-)..
  42.  
  43. Reid
  44. --
  45. Reid Ellis                                            
  46. rae@utcs.utoronto.ca        ||           rae@Alias.com
  47. CDA0610@applelink.apple.com ||  +1 416 362 9181 [work]
  48.