X11 and ARGB visuals: does DefaultDepth() never return 32?

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-05-15T10:53:22Z Indexed on 2010/05/15 11:04 UTC
Read the original article Hit count: 243

Filed under:
|
|

Hi,

I'm establishing a connection to the X server like this:

display = XOpenDisplay(NULL);
screen = DefaultScreen(display);
depth = DefaultDepth(display, screen);

I'm wondering now why "depth" is always set to 24. I would expect that it is only 24 when compositing is turned off, but in fact, it is still 24 even when I turn on compositing. So in order to get a 32-bit ARGB visual I need to call XGetVisualInfo() first with depth set explicitly to 32.

Now to my question: Will DefaultDepth() generally never return more than 24 or is it just on my system? (my graphics board is somewhat dated...). I know that it could return 15, 16 or even 8 for a CLUT display but can it return 32? Or do I always have to use XGetVisualInfo() first to get a ARGB 32-bit visual?

Thanks,

Andy

© Stack Overflow or respective owner

Related posts about x11

Related posts about compositing