1get_rle_sprite(3) Allegro manual get_rle_sprite(3)
2
3
4
6 get_rle_sprite - Creates an RLE sprite using a bitmap as source. Alle‐
7 gro game programming library.
8
10 #include <allegro.h>
11
12
13 RLE_SPRITE *get_rle_sprite(BITMAP *bitmap);
14
16 Creates an RLE sprite based on the specified bitmap (which must be a
17 memory bitmap). Remember to free this RLE sprite later to avoid memory
18 leaks. Example:
19
20 RLE_SPRITE *rle;
21 BITMAP *bmp;
22 ...
23 /* Create RLE sprite from an existent bitmap. */
24 rle = get_rle_sprite(bmp);
25 if (!rle)
26 abort_on_error("Couldn't create RLE sprite!");
27
28 /* We don't need the bitmap any more.*/
29 destroy_bitmap(bmp);
30
31 /* Use the RLE sprite. */
32 ...
33 /* Destroy it when we don't need it any more. */
34 destroy_rle_sprite(rle);
35
37 Returns a pointer to the created RLE sprite, or NULL if the RLE sprite
38 could not be created. Remember to free this RLE sprite later to avoid
39 memory leaks.
40
41
43 draw_rle_sprite(3), destroy_rle_sprite(3)
44
45
46
47Allegro version 4.2.3 get_rle_sprite(3)