bitmap_color_depth(3alleg4)

✨ NAME ✨

bitmap_color_depth β€” ok so bestie, this is the lil function that tells you the color depth of whatever bitmap you hand it πŸŽ€

And yes, this whole page lives in the Allegro manual, section 3alleg4, aka the Allegro game programming library. Iconic.


🌸 SYNOPSIS 🌸

#include <allegro.h>

int bitmap_color_depth(BITMAP *bmp);

πŸ’… DESCRIPTION πŸ’…

So you pass in a bitmap, right? And it returns the color depth of the specified bitmap. That's it. That's the whole vibe. πŸ¦‹

And the depths you might get back are literally just: 8, 15, 16, 24, or 32. No cap. Those are the five.

Here's the example from the page, and honestly? She's giving practical queen energy:

switch (bitmap_color_depth(screen)) {
   case 8:
      /* Access screen using optimized 8-bit code. */
      break;
   default:
      /* Use generic slow functions. */
      break;
}

Lowkey the takeaway here is: check the depth, and if you're in that 8 case you can flex with optimized 8-bit code. Anything else? You're on the generic slow functions. Not a read, just the facts πŸ’€


🫢 SEE ALSO 🫢


Anyway bestie, that's the whole page! This one came to you straight from the Allegro manual, courtesy of Allegro version 4.4.3 πŸ’– go forth and check your color depths, mwah 😭✨