get_color_depth(3alleg4)
π get_color_depth π
okay so bestie, this one lives in the Allegro manual (the get_color_depth(3alleg4) page, if you're being formal about it) and it's literally the cutest little function that tells you what pixel format you're working with rn. no cap.
β¨ NAME β¨
get_color_depth β returns the current pixel color depth. Allegro game programming library. yes she's a whole vibe. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int get_color_depth(void);
look at her. no arguments. she simply returns and minds her business. main character energy fr fr. π
π¦ DESCRIPTION π¦
so this function returns the current pixel format. and likeβ¦ that's actually so useful bestie, because if you're writing generic functions β the kind that pick a different code path internally depending on which color depth is in use β you literally need to know this. it's giving "adaptive queen". π
β οΈ okay important thing, don't skip this: the function returns whatever value you may have 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. iykyk.
π SEE ALSO π
set_color_depth(3alleg4)β the one that sets the thing β¨bitmap_color_depth(3alleg4)β the one you actually want if it's the screen's depth you're after π«Άexrgbhsv(3alleg4)β an example, go look at it, she ate π
and that's the page babes! π§ this was pulled from Allegro version 4.4.3, so if your get_color_depth(3alleg4) is acting different, check your version bestie. stay slay, keep your color depths correct, and don't forget to bitmap_color_depth() when it matters. mwah ππΈ
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms