1get_compiled_sprite(3)          Allegro manual          get_compiled_sprite(3)
2
3
4

NAME

6       get_compiled_sprite  -  Creates  a  compiled  sprite  using a bitmap as
7       source. Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       COMPILED_SPRITE *get_compiled_sprite(BITMAP *bitmap, int planar);
14

DESCRIPTION

16       Creates a compiled sprite based on the specified bitmap (which must  be
17       a memory bitmap). Compiled sprites are device-dependent, so you have to
18       specify whether to compile it into a  linear  or  planar  format.  Pass
19       FALSE  as  the  second parameter if you are going to be drawing it onto
20       memory bitmaps or mode 13h and SVGA screen bitmaps, and  pass  TRUE  if
21       you  are  going  to draw it onto mode-X or Xtended mode screen bitmaps.
22       Example:
23
24          COMPILED_SPRITE *cspr;
25          BITMAP *bmp;
26          ...
27          /* Create compiled sprite from an existent bitmap. */
28          cspr = get_compiled_sprite(bmp, 0);
29          if (!cspr)
30             abort_on_error("Couldn't create compiled sprite!");
31
32          /* We don't need the bitmap any more.*/
33          destroy_bitmap(bmp);
34
35          /* Use the compiled sprite. */
36          ...
37          /* Destroy it when we don't need it any more. */
38          destroy_compiled_sprite(cspr);
39
40       Returns a pointer to the created compiled sprite, or NULL if  the  com‐
41       piled  sprite  could  not  be  created.  Remember to free this compiled
42       sprite later to avoid memory leaks.
43
44

SEE ALSO

46       draw_compiled_sprite(3), destroy_compiled_sprite(3)
47
48
49
50Allegro                          version 4.4.3          get_compiled_sprite(3)
Impressum