Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!gr.utah.edu!gershon From: gershon%gr.utah.edu@cs.utah.edu (Elber Gershon) Newsgroups: comp.os.msdos.programmer Subject: Re: Need a good line drawing function for VGA Message-ID: <1991Mar14.133713.7981@hellgate.utah.edu> Date: 14 Mar 91 20:37:12 GMT References: <1991Mar14.020823.5530@cc.helsinki.fi> <1991Mar14.152927.25350@ux1.cso.uiuc.edu> <1991Mar14.182134.1368@nntp-server.caltech.edu> Organization: University of Utah CS Dept Lines: 30 In article <1991Mar14.182134.1368@nntp-server.caltech.edu> nyet@nntp-server.caltech.edu (prof. n liu) writes: >mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: > > >>You do what you want by noting that one bit plane controls red and another >>one blue. You simply instruct the VGA (or EGA) controller to write >>to ONLY the red plane when doing red and ONLY the blue plane when doning >>blue - then you can use either XOR or OR mode quite well. > >This should certainly work... and guess what? MSC does in fact have an OR mode >for all graphics, if you are lazy (and, of course, assuming you have MSC >around :). Which brings me to another point.. is there an equivalent "driver" >standard like .bgi for msc and code to load them, or do you have to do >everything yourself - like writing svga routines from scratch (and, of course >coding line drawing algorithms like Bresenham's manually). What a drag. > >nyet Gee. Correct me if I am wrong but what the original author really wanted is the combined color to be magenta (i.e. both red and blue are active). OR will not do it! Both OR and XOR will operate on the color INDICES and not on the color RGB components. If for example red index is 1 and blue is 3 then OR will return 3 or again blue (convert the numbers to binary)! XOR will return 2, so all needs to be done is: 'setrgbpallete(2, 63, 0, 63)' or setting the color table second entry to the magenta color. Gershon P.S. This does not mean that pixel OR may not be useful and that I would not like to see the BGI protocol supporting it.