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