desktop_color_depth (3) - Linux Manuals
desktop_color_depth: Finds out the desktop color depth. Allegro game programming library.
NAME
desktop_color_depth - Finds out the desktop color depth. Allegro game programming library.SYNOPSIS
#include <allegro.h>
DESCRIPTION
Finds out the currently selected desktop color depth. You can use this information to make your program use the same color depth as the desktop, which will likely make it run faster because the graphic driver won't be doing unnecessary color conversions behind your back.Under some OSes, switching to a full screen graphics mode may automatically change the desktop color depth. You have, therefore, to call this function before setting any graphics mode in order to retrieve the real desktop color depth. Example:
allegro_init(); ... if ((depth = desktop_color_depth()) != 0) { set_color_depth(depth); }