al_convert_memory_bitmaps(3alleg5)

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

✨ al_convert_memory_bitmaps ✨

okay bestie, so this one lives in the Allegro 5 API and it's genuinely one of those "wait, that's it?" functions that saves your whole entire life. let's get into it πŸ’–


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

void al_convert_memory_bitmaps(void)

like… that's the whole signature. no args, no return, just vibes and a glow-up. πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

so here's the tea, bestie πŸ“

if you create a bitmap when there is no current display β€” for example because you haven't called al_create_display(3alleg5) in the current thread β€” and you're using the ALLEGRO_CONVERT_BITMAP bitmap flag (which, btw, is set by default, no cap), then the bitmap will be created successfully… but as a memory bitmap. it's giving "made it work, but at what cost" 😭

and that's literally what this function is for. al_convert_memory_bitmaps converts all such bitmaps to proper video bitmaps belonging to the current display. glow-up complete, main character energy, periodt πŸ‘‘

⚠️ also important: video bitmaps get automatically converted back to memory bitmaps when the last display is destroyed. so it's a whole two-way street, iykyk.

and one more thing because details matter:

this operation will preserve all bitmap flags except ALLEGRO_VIDEO_BITMAP and ALLEGRO_MEMORY_BITMAP. those two? yeah, they get rewritten, that's the whole point of the conversion. everything else stays exactly as it was πŸ’œ


🌈 SINCE 🌈

5.2.0 β€” so she's been iconic for a minute ✨


πŸŽ€ SEE ALSO πŸŽ€


and that's the page!! 🫢 from the Allegro reference manual, filed under al_convert_memory_bitmaps(3alleg5) β€” go forth and convert those bitmaps, bestie, you're literally so good at this πŸ’–πŸŒΈπŸ’…

πŸ“¦ where this page comes from