[AD] [WIN] desktop_color_depth() again

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


Just an improved fix for the desktop_color_depth() problem, in order to
shield the code from a buggy user-defined window.

src/win/wsystem.c:
/* sys_directx_desktop_color_depth:
 *  Returns the current desktop color depth.
 */
static int sys_directx_desktop_color_depth(void)
{
   HDC dc;
   int depth;

   dc = GetDC(NULL);  /* NULL = the entire screen */
   depth = GetDeviceCaps(dc, BITSPIXEL);
   ReleaseDC(NULL, dc);

   return depth;
}

--
Eric Botcazou (ebotcazou@xxxxxxxxxx)
Web Site: http://www.multimania.com/ebotcazou




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