fli_bmp_dirty_from(3alleg4)
π fli_bmp_dirty_from β bestie edition π
okay so this is a page from the Allegro manual (that's 3alleg4, the Allegro game programming library, and we're in the FLI section, iykyk) π
β¨ NAME β¨
fli_bmp_dirty_from, fli_bmp_dirty_to β these two tell you which parts of the image have actually changed. part of the Allegro game programming library. periodt. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
extern int fli_bmp_dirty_from;
extern int fli_bmp_dirty_to;
π¦ DESCRIPTION π¦
okay so listen, these two variables get set by next_fli_frame(), and what they do is tell you which part of the fli_bitmap has changed since the last time somebody called reset_fli_variables(). that's it, that's the whole job π«Ά
here's the vibe check:
- if
fli_bmp_dirty_fromis greater thanfli_bmp_dirty_toβ bestie, nothing changed, the bitmap is untouched, go home π - otherwise β lines
fli_bmp_dirty_fromtofli_bmp_dirty_to(inclusive, don't forget that part π) have altered
so when you're copying the fli_bitmap onto the screen, you can use these to avoid moving data unnecessarily. no need to haul the whole bitmap across town when only a few lines are different, that's just wasteful and we don't do that here π
the example, verbatim, no notes:
if (fli_bmp_dirty_from <= fli_bmp_dirty_to)
blit(fli_bitmap, screen, 0, fli_bmp_dirty_from,
0, fli_bmp_dirty_from, fli_bitmap->w,
fli_bmp_dirty_to - fli_bmp_dirty_from + 1);
not me obsessed with a two-variable dirty rectangle system π iconic honestly
π SEE ALSO π
and that's the whole page bestie, go forth and blit responsibly π§β¨
mwah π this was Allegro, version 4.4.3, and yeah it's the fli_bmp_dirty_from(3alleg4) page, thanks for coming to my ted talk, ily, bye π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms