al_draw_tinted_bitmap(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_draw_tinted_bitmap πŸ’–

okay bestie, gather round, because this is one of those Allegro 5 API functions that is lowkey iconic and you're gonna want it in your group chat of go-to calls ✨


🌸 NAME 🌸

al_draw_tinted_bitmap β€” Allegro 5 API, the tinted-bitmap queen πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro.h>

void al_draw_tinted_bitmap(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR tint,
   float dx, float dy, int flags)

πŸ’… DESCRIPTION πŸ’…

So it's giving al_draw_bitmap(3alleg5) energy, but with a glow-up: it multiplies every single color in the bitmap by the color you hand it as the tint. literally a vibe filter for your pixels πŸŽ€

wanna see? here's the receipts:

al_draw_tinted_bitmap(bitmap, al_map_rgba_f(0.5, 0.5, 0.5, 0.5), x, y, 0);

that one right there draws the bitmap 50% transparently πŸ’§ (and yes, with the default blend mode the r/g/b values need to be pre-multiplied with the alpha component β€” that's the tea, don't skip it πŸ™ˆ).

and then:

al_draw_tinted_bitmap(bitmap, al_map_rgba_f(1, 0, 0, 1), x, y, 0);

this one only draws the red component of the bitmap. just red. nothing else. main character behavior fr fr πŸ”₯

🫢 heads up bestie: go read al_draw_bitmap(3alleg5) for the note on restrictions on which bitmaps can be drawn where. not all bitmaps are invited to every party, iykyk πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, no cap ✨ this lil legend lives in the Allegro reference manual, dated al_draw_tinted_bitmap(3alleg5) β€” go forth and tint slay πŸ’…πŸŒˆπŸ’œ

πŸ“¦ where this page comes from