al_lock_bitmap_region(3alleg5)
π NAME π
okay so bestie, this is al_lock_bitmap_region β it's giving Allegro 5 API and it's here to let you lock just a lil slice of a bitmap instead of the whole entire thing. slay. π
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
ALLEGRO_LOCKED_REGION *al_lock_bitmap_region(ALLEGRO_BITMAP *bitmap,
int x, int y, int width, int height, int format, int flags)
π¦ DESCRIPTION π¦
So it's literally the same vibe as al_lock_bitmap(3alleg5), except β plot twist β you only lock one specific area of the bitmap. iconic. β¨
If the bitmap is a video bitmap, then only that lil area of the texture gets updated when you unlock it. no cap. And here's the tea, bestie: locking only the region you intend to modify is genuinely faster than locking the whole entire bitmap, so don't be out here locking everything like a rookie. π
Note: okay so if you're usingALLEGRO_LOCK_WRITEONLYwith a blocked pixel format β and by "blocked" I mean any format whereal_get_pixel_block_width(3alleg5)oral_get_pixel_block_height(3alleg5)does not return1β then for optimal performance your region needs to be aligned to the block width. π If it's not aligned, the function has to lock the region withALLEGRO_LOCK_READWRITEinstead, just so it can pad the region out with valid data. it's giving "fine, I'll do it myself" energy. π
π SEE ALSO π
and that's the whole page, periodt. π this was the Allegro reference manual serving al_lock_bitmap_region(3alleg5) realness β go lock your regions responsibly, bestie, ily π«ΆπΈ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms