Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Alpha Channel and QuickDraw?



I have a silly little question - it is more of a QuickDraw question than an
OpenGL one, but I will ask it both places here.

I am creating an "overlay" image that is overlaid using OpenGL on a second
image, by drawing to a buffer using QuickDraw. The idea is that the overlay
is transparent except for where I am drawing, or that's what I want at
least.

I seem to recall seeing something in some session at WWDC 2002 to the effect
that, if you start off with a QuickDraw image buffer that is completely
zeroes, you could use this as a blank transparent canvas. As you draw on
it, the OS sets the alpha for the pixels you are drawing to totally opaque
for you. That way you can easily use QuickDraw to draw objects that are on
a transparent background.

Did I dream this? Or is this in fact how it is supposed to work? Is this
something that CoreGraphics guaruntees but QuickDraw does not?

I am getting some odd, almost-right behavior. It usually works the way I
described above, 9 times out of 10. But every once in a while part or all
of the overlay is not drawing.

I am drawing a circle followed by a rectangle. Usually both of them draw,
but sometimes only the circle draws. And sometimes nothing at all draws, as
if the entire image is transparent.

Is it supposed to work the way I am remembering - QD setting the alpha
channel where you are drawing to all opaque as it draws? Or do I need to do
that manually?

If QuickDraw does work the way I think it should, then either I have a bug
somewhere, or QuickDraw does. (Or something does.) If I am completely
misremembering, and I should instead be setting the alpha channel manually,
that would be helpful to know, because then I am wasting my time looking
elsewhere for a bug in my code here.

It seems to work that way 9 times out of 10, but maybe it is an unintended
side effect of the way something in QuickDraw is working that I am seeing,
and that's why it is intermittant?

(BTW this is on MacOS 10.2.2.)

-- Bobby

---------------------------------------------------------------------
Bobby Thomale
Senior Software Developer
Inoveon Corporation
http://www.inoveon.com/
---------------------------------------------------------------------
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.