set_color_depth(3alleg4)
set_color_depth π
okay bestie, welcome to the Allegro manual β specifically the set_color_depth(3alleg4) page, and yes it's the Allegro game programming library, we're being β¨fancyβ¨ today.
β¨ NAME β¨
set_color_depth β sets the global pixel color depth π
(Allegro game programming library, for all my game-dev girlies π)
π¦ SYNOPSIS π¦
#include <allegro.h>
void set_color_depth(int depth);
πΈ DESCRIPTION πΈ
So basically this function sets the pixel format that all your future calls to set_gfx_mode() and create_bitmap() are gonna use. It's giving "setting the vibe before the party starts" π
The valid depths are 8 (which is the default, no cap), 15, 16, 24, and 32 bits. Pick your fighter π
Example, since a demo always eats:
set_color_depth(32);
if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0) {
abort_on_error("Couldn't set a 32 bit color resolution");
}
β οΈ okay important, don't skip this: the screen color depth won't actually change until the next successful call to set_gfx_mode(). So like, setting it does nothing visible on its own. It's the setup, not the show. fr fr π«Ά
π SEE ALSO π
get_color_depth(3alleg4)set_gfx_mode(3alleg4)set_color_conversion(3alleg4)makecol(3alleg4)getr(3alleg4)desktop_color_depth(3alleg4)
and that's the whole page, bestie!! this was Allegro version 4.4.3, served fresh from the set_color_depth(3alleg4) manual page, and honestly? iconic. go set your color depth and slay π
β¨ππ
π¦ 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