[fa.info-mac] Bypassing Quickdraw

info-mac@uw-beaver (info-mac) (09/29/84)

From: Gustavo Fernandez <FERNANDEZ@SU-SCORE.ARPA>
If you look carefully, you will notice that this is exactly what 
quickdraw does when drawing on top of the cursol. However,
it is very smart, and knows when it has to hide the cursor and when it
it can be left alone. By the way, quickdraw isn't sacred at al.
There are a number of instances where it is best to do your own screen
hacking (albeit not many)
 
1. When implementing line operations where a descision must be made at
each point on the line. Z buffering for 3-D graphics is a good example.
 
2. When dealing with the screen on a pixel-by pixel basis. A conventional
implemntation of LIFE might be a good example. However, there are array
based algorithms (see the SMALLTALK issue of BYTE a few Augusts back)
which would use a series of at least 34 COPYBITS operations per generation.
Because of the highly optimized nature of COPYBITS, this might be more
efficient than pixel by pixel for a large field (the entire screen)
 
3. When doing apple II style picture block arcade graphics. Again, this
has yet to be seen whether copybits is not faster. Here, I believe, an
advantage would be gained with small objects.
 
4. when implementing bizarre things like the system bugs desk accessory.
 
Perhaps Bill Atkinson might take exception to asll this. If so, i would not
mind being proven wrong. In any case, it is still a very good idea to at least
use quickdraw to open a grafport and get your screen parameters from 
there. Under no circumstances should you hardwire things like screen
address and vertical and horisontal resolution.
 
						Gus Fernandez
						FERNANDEZ@SU-SCORE
-------

info-mac@uw-beaver.UUCP (10/12/84)

From: Larry Rosenstein <lsr%apple.csnet@csnet-relay.arpa>
If you want to draw directly onto the screen bitmap, the proper call to
make is to ShieldCursor:

  PROCEDURE ShieldCursor(shieldRect: Rect; offsetPt: Point);

where shieldRect is the rectangle you want to modify, and offsetPoint is
(0, 0) if shieldRect is in global coordinates and the topLeft of the
grafPort's boundary rectangle if in local coordinates.  (ShieldCursor
offsets the shieldRect by offsetPt.)  The routine removes the cursor from
the screen only if it intersects the given rectangle, and you MUST
balance the call to ShieldCursor with a call to ShowCursor.

Since you are going directly to the bitmap, your rectangle would probably
be in global coordinates, so offsetPt would be (0, 0).  (Even though you
are going to the screen directly, you should still have initialized
Quickdraw and setup a grafport.)

Note that the above information is from a review draft of the Toolbox
Utilities section of Inside Macintosh, which I just received today.  The
description of this routine is substantially changed from the previous
draft of that section.

P.S.  I don't think Bill Atkinson would take exception to your trying to
bypass Quickdraw.  If I am not mistaken, MacPaint also bypasses Quickdraw
in places, in order to get better performance.

Larry Rosenstein
Apple Computer