views:

143

answers:

1

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

A: 

There is a "DefaultDepth" parameter in xorg.conf, in section "Screen". Try to change it.

Depth is detected from root_depth field: http://www.google.com/codesearch?hl=en&safe=off&q=root_depth&aq=f&aqi=g-sx10&aql=&oq=&gs_rfai=

osgx