al_clone_bitmap(3alleg5)

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

πŸ’– al_clone_bitmap πŸ’–

okay bestie, so this is a page from the Allegro 5 API reference manual, and we're gonna talk about the girlboss move that is cloning a bitmap. no cap, it's giving "copy my whole fit but in a new body." ✨


✨ NAME ✨

al_clone_bitmap β€” she's part of the Allegro 5 API, and she makes a whole new bitmap that's a copy of an old one. iconic behavior honestly πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

ALLEGRO_BITMAP *al_clone_bitmap(ALLEGRO_BITMAP *bitmap)

like, you hand her a bitmap pointer and she hands you back a fresh ALLEGRO_BITMAP *. simple. clean. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So what's actually happening here? al_clone_bitmap creates a brand new bitmap using al_create_bitmap(3alleg5), and then copies all the pixel data from the old bitmap across. boom, twin. πŸ‘―

Here's the tea though, and this part matters, no cap: the newly created bitmap gets made with the current new bitmap flags β€” not the ones that were used to create the original bitmap. so if you changed your new bitmap flags since you made the original, your clone is gonna reflect those, not the originals. vibe check passed but stay aware bestie. πŸ‘€

And one more lil detail: if the new bitmap is a memory bitmap, its projection bitmap gets reset to be orthographic. lowkey important, highkey useful. 🌈


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page fr fr. this was the Allegro reference manual talking about al_clone_bitmap(3alleg5) β€” go forth and clone responsibly, you absolute legend. periodt. πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from