[comp.sys.mac.programmer] Drawing in XOR with masking?

baer@qiclab.scn.rain.com (Ken Baer) (03/08/91)

I have a technical graphics question that I have not been able to get
answered yet.  I have only been working on the Mac for the last few
months, but have done a lot of graphics programming on the Amiga (no
derogatory comments please :-).  

I am trying to draw in XOR mode, but with plane masking, so I can draw
in the color I want, and be able to XOR those colors.  On the Amiga we
were able to do with by using SetMask() with COMPLIMENT draw mode.  I
have, so far, been unable to find an equivalent on the Mac.  I'm writing
this for an interface for a 3D object modeller, which needs to use color
for highlighting control points, so I need to use XOR for real time
manipulation, but I need to have control over what colors I'm drawing in.

So far, all of the examples of XOR I've seen are in B&W.  I assume that
there must be some other people out there doing what I'm trying to do.
If you have some suggestions, or better yet, sample code, please e-mail
it to me.  This is a major problem right now (for this project), so any
help is greatly appreciated.  Thanks in advance!

	-Ken Baer.
	Hash Enterprises
	baer@qiclab.UUCP
-- 
    //    -Ken Baer.  Programmer/Animator, Hash Enterprises / Earthling
  \X/     Usenet: baer@qiclab.UUCP  or  PLink: KEN BAER
         "What?!? Sore again?" -- Bugs Bunny to Yosemity Sam

russotto@eng.umd.edu (Matthew T. Russotto) (03/09/91)

In article <1991Mar7.190620.19609@qiclab.scn.rain.com> baer@qiclab.scn.rain.com (Ken Baer) writes:
>I have a technical graphics question that I have not been able to get
>answered yet.  I have only been working on the Mac for the last few
>months, but have done a lot of graphics programming on the Amiga (no
>derogatory comments please :-).  
>
>I am trying to draw in XOR mode, but with plane masking, so I can draw
>in the color I want, and be able to XOR those colors.  On the Amiga we
>were able to do with by using SetMask() with COMPLIMENT draw mode.  I
>have, so far, been unable to find an equivalent on the Mac.  I'm writing
>this for an interface for a 3D object modeller, which needs to use color
>for highlighting control points, so I need to use XOR for real time
>manipulation, but I need to have control over what colors I'm drawing in.

Most Mac graphics is done with 'chunky' pixels, not planar, so the idea of
plane masking is not used.  You can still use regular XOR, but the colors
of the XORd objects will look wierd.  I can't find a color complement mode
in Inside Mac, but one trick you might want to use is to set up the color
table in such a way that XORING pixel values produces the complement of the
color-- you have to be careful under multifinder, but it is doable.
--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
     .sig under construction, like the rest of this campus.
I mine 600 wells, and whaddo I get?  Another day older and deeper in debt!
	--- Saddam Hussein.