get_compiled_sprite(3alleg4)
β¨ get_compiled_sprite β¨
okay bestie, welcome to the Allegro manual β this one's get_compiled_sprite(3alleg4), and it's giving compiled sprite energy π
πΈ NAME πΈ
get_compiled_sprite β makes you a compiled sprite, using a bitmap as the source. It's part of the Allegro game programming library, no cap. π
π SYNOPSIS π
#include <allegro.h>
COMPILED_SPRITE *get_compiled_sprite(BITMAP *bitmap, int planar);
π DESCRIPTION π
So basically, this function creates a compiled sprite based on the bitmap you hand it β and heads up, that bitmap must be a memory bitmap, fr fr, no exceptions. π
Compiled sprites are device-dependent, which means you have to tell it whether you want it compiled into a linear format or a planar format. The way you do that is with the second parameter:
- pass
FALSEif you're gonna be drawing it onto memory bitmaps, mode 13h, or SVGA screen bitmaps - pass
TRUEif you're gonna be drawing it onto mode-X or Xtended mode screen bitmaps
Choose wrong and it's not gonna slay for you, so pick wisely bestie. β¨
Here's the whole vibe in an example:
COMPILED_SPRITE *cspr;
BITMAP *bmp;
...
/* Create compiled sprite from an existent bitmap. */
cspr = get_compiled_sprite(bmp, 0);
if (!cspr)
abort_on_error("Couldn't create compiled sprite!");
/* We don't need the bitmap any more.*/
destroy_bitmap(bmp);
/* Use the compiled sprite. */
...
/* Destroy it when we don't need it any more. */
destroy_compiled_sprite(cspr);
It returns a pointer to the compiled sprite it just made, or NULL if it couldn't be created at all. π And listen β remember to free this compiled sprite later to avoid memory leaks. Don't be the girl who leaks memory, that's not the vibe. π«Ά
π¦ SEE ALSO π¦
and that's the whole page, periodt π β this was Allegro, version 4.4.3, bringing you get_compiled_sprite(3alleg4). go compile something iconic, bestie πβπ₯
π¦ 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