1desktop_color_depth(3) Allegro manual desktop_color_depth(3)
2
3
4
6 desktop_color_depth - Finds out the desktop color depth. Allegro game
7 programming library.
8
10 #include <allegro.h>
11
12
13 int desktop_color_depth();
14
16 Finds out the currently selected desktop color depth. You can use this
17 information to make your program use the same color depth as the desk‐
18 top, which will likely make it run faster because the graphic driver
19 won't be doing unnecessary color conversions behind your back.
20
21 Under some OSes, switching to a full screen graphics mode may automati‐
22 cally change the desktop color depth. You have, therefore, to call this
23 function before setting any graphics mode in order to retrieve the real
24 desktop color depth. Example:
25
26 allegro_init();
27 ...
28 if ((depth = desktop_color_depth()) != 0) {
29 set_color_depth(depth);
30 }
31
33 Returns the color depth or zero on platforms where this information is
34 not available or does not apply.
35
36
38 get_desktop_resolution(3), set_color_depth(3), set_gfx_mode(3)
39
40
41
42Allegro version 4.4.2 desktop_color_depth(3)