get_color_depth(3)
β¨ get_color_depth β¨
okay so bestie, welcome to the Allegro manual π this one's called get_color_depth(3) and it's genuinely so useful, no cap.
πΈ NAME πΈ
get_color_depth β returns the current pixel color depth. Part of the Allegro game programming library. π
π¦ SYNOPSIS π¦
#include <allegro.h>
int get_color_depth(void);
π DESCRIPTION π
So basically it returns the current pixel format. β¨
And likeβ¦ why do you care? Because this is the move when you wanna write generic functions that internally pick a different code path depending on which color depth is being used. it's giving "one function, many depths", and honestly? iconic. π
π«Ά heads up bestie, this is the important part: the function returns whatever value you set previously withset_color_depth(), which can be different from the current color depth of thescreenglobal variable. so if you really need to know the color depth of the screen, usebitmap_color_depth()instead. fr fr. don't get caught lacking. π
π SEE ALSO π
Allegro, version 4.4.3 β and that's the whole page, get_color_depth(3), slay π
β¨ go check your depths bestie, you got this π¦ππ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms