Re: [AD] X11 desktop_color_depth()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 20 Nov 2001, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> On November 20, 2001 10:49 pm, you wrote:
> > static int _xwin_sysdrv_desktop_color_depth(void)
> > {
> >    if (_xwin.window_depth <= 8)
> >       return 8;
> >    else if (_xwin.window_depth <= 16)
> >       return 16;
> >    else
> >       return 32;
> > }
> 
> Well since allegro doesn't support depths < 8bpp that can be 'OK'.
> And X will not give a 15bpp or 24bpp depth screen. (from my limited
> understanding of X anyway) When asking X it will say 15 is 16 and
> 24 is 32. (but X also differentiates from bpp (depth) and fbpp (frame buffer 
> bits per pixel...)

When you are in a 15 bpp X server, desktop_color_depth() returns 16.
That's not very good.  I can't test 24 bpp, but I assume it will
return 32.

What values can _xwin.window_depth take?  In xwin.c, there is the
following snippet of code:

   /* Get associated visual and window depth (bits per pixel).  */
   XGetWindowAttributes(_xwin.display, _xwin.window, &getattr);
   ...
   _xwin.window_depth = getattr.depth;



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/