1al_get_parent_bitmap(3) al_get_parent_bitmap(3)
2
3
4
6 al_get_parent_bitmap - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 ALLEGRO_BITMAP *al_get_parent_bitmap(ALLEGRO_BITMAP *bitmap)
12
14 Returns the bitmap this bitmap is a sub-bitmap of. Returns NULL if
15 this bitmap is not a sub-bitmap. This function always returns the real
16 bitmap, and never a sub-bitmap. This might NOT match what was passed
17 to al_create_sub_bitmap(3). Consider this code, for instance:
18
19 ALLEGRO_BITMAP* a = al_create_bitmap(512, 512);
20 ALLEGRO_BITMAP* b = al_create_sub_bitmap(a, 128, 128, 256, 256);
21 ALLEGRO_BITMAP* c = al_create_sub_bitmap(b, 64, 64, 128, 128);
22 ASSERT(al_get_parent_bitmap(b) == a && al_get_parent_bitmap(c) == a);
23
24 The assertion will pass because only a is a real bitmap, and both b and
25 c are its sub-bitmaps.
26
28 5.0.6, 5.1.2
29
31 al_create_sub_bitmap(3), al_is_sub_bitmap(3)
32
33
34
35Allegro reference manual al_get_parent_bitmap(3)