Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!sdd.hp.com!decwrl!ucbvax!bloom-beacon!eru!luth!sunic!kth.se!cyklop.nada.kth.se!news From: d88-jwa@dront.nada.kth.se (Jon W{tte) Newsgroups: comp.sys.mac.programmer Subject: Re: Access to hardware framebuffer (Color QD) Message-ID: <1990Aug22.110820.8154@nada.kth.se> Date: 22 Aug 90 11:08:20 GMT References: <1990Aug21.182827.19315@nada.kth.se> <9880@goofy.Apple.COM> Distribution: comp Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 42 In article <9880@goofy.Apple.COM> lsr@Apple.COM (Larry Rosenstein) writes: >>Actually, that is "set the ports RGBFgColor to the value of X" >>fgColor is old-style color, with only 8 predefined colors available. >I originally thought so too. But a color GrafPort also has a fgColor field, >which might be a cache of the index of the foreground color. (It may even >be at the same offset as fgColor in an old port, I didn't check.) Well, this certainly seems both documented and stable... (Heavy Irony :-) >> RGBForeColor(&colors[index]); >I doubt that you'd want to have an array of all 16 million colors. Don't Of course not. He wanted to have his own lookup table, with indicies from 0 to 255. Thus, you create: RGBColor colors[256]; int index; You're not guaranteed to get the colors you want this easily on less- than-24-bit screens, though (thus the Pallette manager) >>You want to XOR into video index memory !? You'll have to blast the >>bits yourself. This gets VERY complicated VERY fast (like, don't forget >Actually you can use patXOR mode with color, provide you remember that >QuickDraw uses the pen patterns in the transfer mode. Well, he wanted to xor the INDICIES, not the colors. Like, say 0 == blue, and 1 == red, and 2 == black and 3 == green: DrawInColor(1); /* Gives a red drawing */ XORWith(2) /* Makes the red pixels green, and the blue black */ This is an old approach to video handling, but he said he was porting old applications... h+ Jon W{tte, Stockholm, Sweden, h+@nada.kth.se