home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6121 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  1.8 KB

  1. Path: sparky!uunet!rosie!NeXT.com
  2. From: sam_s@NeXT.com (Sam Streeper)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: What happened to "instance drawing"
  5. Message-ID: <4975@rosie.NeXT.COM>
  6. Date: 11 Sep 92 21:58:55 GMT
  7. References: <1992Sep9.181506.829@proforma.com>
  8. Sender: news@NeXT.COM
  9. Reply-To: sam_s@NeXT.com
  10. Lines: 36
  11.  
  12. jgg@proforma.com (J. G. Gregory) writes:
  13. > Way back when, there was this feature called "instance drawing".  It was  
  14. > documented in the Concepts docs, as well as the function docs.  Now I can't  
  15. > seem to find a description of it, except for the function definitions.  I  
  16.  
  17. When you use a buffered window, all your drawing goes to the buffer and
  18. isn't immediately visible.  You make it visible by doing a flushWindow,
  19. which copies the changed bits in the buffer to the visible areas of the
  20. screen.
  21.  
  22. When you turn on instance drawing, you draw directly onto your window's
  23. area on the screen, and the drawing never touches the buffer, so it doesn't
  24. get saved.  It can be used for temporary drawing or animation, but since  
  25. there's no buffering you see the erasures happening and it tends to look
  26. flickery (and to my eye, cheesy and unprofessional)
  27.  
  28. The basic algorithm looks like this:
  29.  
  30. PSsetinstance(YES);
  31. while (temporaryAnimation) {
  32.     PSnewinstance();    // erase old instance drawing
  33.     [self drawSomething];    // draw temporary stuff
  34.     }
  35. PSsetinstance(NO);
  36.  
  37. I suggest you avoid instance drawing, and instead look at Draw or
  38. ScrollDoodScroll's NiftyMatrix to see how to do double buffered animations.
  39.  
  40. -sam
  41. ps I noticed last night that NiftyMatrix has an error that causes it to cache
  42. its browser incorrectly.  The solution is to remove the call to
  43. convertFromSuperview.
  44.  
  45. --
  46. Opinions expressed herein are not those of my employer.  They're not even
  47. mine.  They're probably wrong besides.  How did they get in here, anyway?
  48.