al_backup_dirty_bitmap(3alleg5)

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

πŸ’– NAME πŸ’–

al_backup_dirty_bitmap β€” it's the Allegro 5 API function that saves your bitmaps' whole entire life, no cap 🫢

(it lives in the 3alleg5 manual, bestie, iykyk)


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

void al_backup_dirty_bitmap(ALLEGRO_BITMAP *bitmap)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen. on some platforms β€” most notably Windows Direct3D and Android β€” your textures can just... get lost at literally any moment 😭. we're talking events like a display resize, or the app switching out (you know, when someone yanks you to the home screen mid-vibe). gone. poof. not the move.

on those platforms, any bitmap you made without the ALLEGRO_NO_PRESERVE_TEXTURE flag gets automatically backed up into system memory every single time al_flip_display is called. like, autosave but make it textures πŸ’…. iconic behaviour, honestly.

this function? this function hands you the aux cord. πŸŽ€ it gives you way more control over when your bitmaps get backed up. so instead of waiting around for the next flip to do it, you just call this right after you modify a bitmap, and boom β€” that bitmap is backed up right away instead of during the next flip. instant. immediate. slay.

it's giving "i'll do it myself" energy and honestly? we respect it πŸ‘‘

⭐ SINCE ⭐

5.2.1 β€” yeah she's new here, baby 🌸

[Unstable API]: this API is new and subject to refinement. so like... she's still growing, be gentle with her πŸ™ˆ

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! ✨ brought to you by the Allegro reference manual, and yeah the footer said the same thing (al_backup_dirty_bitmap(3alleg5)) so you know it's official πŸŽ€πŸ’– go forth and back up those dirty bitmaps, periodt πŸ’…

πŸ“¦ where this page comes from