al_backup_dirty_bitmap(3)
πΎ al_backup_dirty_bitmap(3) β the Allegro 5 API glow-up β¨
Okay bestie, so this one's from the Library Functions Manual and it's literally the Allegro 5 API. Let's get into it π«Ά
πΈ NAME πΈ
al_backup_dirty_bitmap β Allegro 5 API, the "save my texture before it gets yeeted" function π
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
void al_backup_dirty_bitmap(ALLEGRO_BITMAP *bitmap)
π¦ DESCRIPTION π¦
So here's the tea β: on some platforms β notably Windows Direct3D and Android β textures can be lost at any time π for events like display resize or switching out of the app. Like, they're just gone, no cap.
On those platforms, bitmaps created without the ALLEGRO_NO_PRESERVE_TEXTURE flag automatically get backed up to system memory every single time al_flip_display is called. Iconic behaviour, honestly π
This function gives you more control over when your bitmaps get backed up π. By calling this function after modifying a bitmap, you can make sure the bitmap is backed up right away instead of during the next flip. It's giving "I'll do it myself" energy, and we love that for you.
π SINCE π
5.2.1 β a whole era π«
β οΈ [Unstable API]: This API is new and subject to refinement. So like, it works, but it might change on you β proceed with your eyes open, bestie π
π₯ SEE ALSO π₯
al_backup_dirty_bitmaps(3)β the plural version, for when you have main character energy and multiple bitmaps π―al_create_bitmap(3)β where the bitmap came from in the first place π
And that's the whole page, periodt π. This slay of a manual page comes courtesy of the Allegro reference manual, dated with all the love from the fine folks who write these things β go forth and back up your textures, bestie π§ππ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms