Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: glReadPixels (not getting alpha SOLVED)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glReadPixels (not getting alpha SOLVED)



I've finally identified the culprit. If I request an accelerated GL context:

static NSOpenGLPixelFormatAttribute attrs[] = {
NSOpenGLPFAColorSize, 24,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFADepthSize, 32,
NSOpenGLPFAAccelerated, 1, // <-- note this line
NSOpenGLPFADoubleBuffer, 1,
0
};

...then I get solid alpha (0xff) when I read the color buffer via glReadPixels().

If I comment the NSOpenGLPFAAcelerated line out, I get the alpha I'm expecting (0x00 in places where the cleared background shows through) and everything's fine.

This is on a WallStreet G3 PowerBook (which has the unsupported (under OS X) Rage Pro LT, so therefore I'm getting software rasterization). Isn't NSOpenGLPFAAccelerated a polite request that should simply be ignored and irrelevant on systems that don't have hardware GL support? Is this a bug?

Thanks,
Troy

On Sunday, February 24, 2002, at 01:30 PM, John Stauffer wrote:

Try asking for an alpha channel in the pixel format attribute list.

kCGLPFAAlphaSize, 1
AGL_ALPHA_SIZE, 1

John

On Sunday, February 24, 2002, at 06:45 AM, Troy Stephens wrote:

[...]

I don't know which graphics chipset is in the Lombards, but my WallStreet (1998) PowerBook has a Rage Pro LT, which isn't supported for OpenGL hw. accel. under OS X, so I get software rasterization -- albeit impressively fast software rasterization! :-)

I'm currently having a problem reading back RGBA data via glReadPixels() (the alpha always seems to come back 0xff, regardless of what I clear the alpha to via glClearColor()), and I'm starting to wonder whether it's me...

/\/\o Troy Stephens
/ \ \/\ email@hidden
/ \ \ \ http://homepage.mac.com/troy_stephens
----------------------------------------------------------------------------
_______________________________________________
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.

References: 
 >Re: glReadPixels (From: John Stauffer <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.