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

NAME

6       create_bitmap  -  Creates  a  memory  bitmap.  Allegro game programming
7       library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       BITMAP *create_bitmap(int width, int height);
14

DESCRIPTION

16       Creates a memory bitmap sized width by height.  The  bitmap  will  have
17       clipping  turned on, and the clipping rectangle set to the full size of
18       the bitmap. The image memory will not be cleared, so it  will  probably
19       contain garbage: you should clear the bitmap before using it. This rou‐
20       tine always uses the global  pixel  format,  as  specified  by  calling
21       set_color_depth().   The  minimum  height  of  the BITMAP must be 1 and
22       width can't be negative.  Example:
23
24          /* Create a 10 pixel tall bitmap, as wide as the screen. */
25          BITMAP *bmp = create_bitmap(SCREEN_W, 10);
26          if (!bmp)
27             abort_on_error("Couldn't create bitmap!");
28          /* Use the bitmap. */
29          ...
30          /* Destroy it when we don't need it any more. */
31          destroy_bitmap(bmp);
32

RETURN VALUE

34       Returns a pointer to the created bitmap, or NULL if  the  bitmap  could
35       not  be  created.  Remember  to  free this bitmap later to avoid memory
36       leaks.
37
38

SEE ALSO

40       create_bitmap_ex(3), create_sub_bitmap(3), create_video_bitmap(3), cre‐
41       ate_system_bitmap(3),  destroy_bitmap(3),  set_color_depth(3),  is_mem‐
42       ory_bitmap(3), clear_bitmap(3), clear_to_color(3)
43
44
45
46Allegro                          version 4.2.2                create_bitmap(3)
Impressum