al_lock_bitmap_blocked(3)
π al_lock_bitmap_blocked
okay so real talk: this one is from the Allegro 5 API, and it lives in the Library Functions Manual section β so yes bestie, you found the right page π
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
ALLEGRO_LOCKED_REGION *al_lock_bitmap_blocked(ALLEGRO_BITMAP *bitmap,
int flags)
πΈ DESCRIPTION πΈ
So you know al_lock_bitmap(3)? This is literally that, but with a glow-up for blocked pixel formats β meaning formats where al_get_pixel_block_width(3) or al_get_pixel_block_height(3) don't return 1. This function lets you lock those bitmaps in that format, no cap π
And because it's all about keeping the block vibe intact, it also does not allow format conversion. None. Zero. Not happening π ββοΈ
For bitmap formats with a block size of 1 though? It's identical to calling:
al_lock_bitmap(bmp, al_get_bitmap_format(bmp), flags)
like, same thing, literally π«Ά
β οΈ Note: Currently there are no drawing functions that work when the bitmap is locked with a compressed format. al_get_pixel(3) will also not work. So yeah um π keep that in mind before you go drawing on a compressed locked bitmap, because it's giving nothing works energy π
π SINCE π
5.1.9 β vintage, but make it iconic β¨
π¦ SEE ALSO π¦
and that's the whole page bestie, go lock some bitmaps π§ββοΈπ this has been the Allegro reference manual's take on al_lock_bitmap_blocked(3) β mwah, slay, periodt πβ
π¦ 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