1al_set_new_bitmap_flags(3) al_set_new_bitmap_flags(3)
2
3
4
6 al_set_new_bitmap_flags - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 void al_set_new_bitmap_flags(int flags)
12
14 Sets the flags to use for newly created bitmaps. Valid flags are:
15
16 ALLEGRO_MEMORY_BITMAP
17 Create a bitmap residing in system memory. Operations on, and
18 with, memory bitmaps will not be hardware accelerated. However,
19 direct pixel access can be relatively quick compared to video
20 bitmaps, which depend on the display driver in use.
21
22 Note: Allegro’s software rendering routines are currently some‐
23 what unoptimised.
24
25 Note: Combining ALLEGRO_VIDEO_BITMAP and ALLEGRO_MEMORY_BITMAP
26 flags is invalid.
27
28 ALLEGRO_VIDEO_BITMAP
29 Creates a bitmap that resides in the video card memory. These
30 types of bitmaps receive the greatest benefit from hardware ac‐
31 celeration.
32
33 Note: Creating a video bitmap will fail if there is no current
34 display or the current display driver cannot create the bitmap.
35 The latter will happen if for example the format or dimensions
36 are not supported.
37
38 Note: Bitmaps created with this flag will be converted to memory
39 bitmaps when the last display is destroyed. In most cases it is
40 therefore easier to use the ALLEGRO_CONVERT_BITMAP flag instead.
41
42 Note: Combining ALLEGRO_VIDEO_BITMAP and ALLEGRO_MEMORY_BITMAP
43 flags is invalid.
44
45 ALLEGRO_CONVERT_BITMAP
46 This is the default. It will try to create a video bitmap and
47 if that fails create a memory bitmap. Bitmaps created with this
48 flag when there is no active display will be converted to video
49 bitmaps next time a display is created. They also will remain
50 video bitmaps if the last display is destroyed and then another
51 is created again. Since 5.1.0.
52
53 Note: You can combine this flag with ALLEGRO_MEMORY_BITMAP or
54 ALLEGRO_VIDEO_BITMAP to force the initial type (and fail in the
55 latter case if no video bitmap can be created) - but usually
56 neither of those combinations is very useful.
57
58 You can use the display option ALLEGRO_AUTO_CONVERT_BITMAPS to
59 control which displays will try to auto-convert bitmaps.
60
61 ALLEGRO_FORCE_LOCKING
62 Does nothing since 5.1.8. Kept for backwards compatibility on‐
63 ly.
64
65 ALLEGRO_NO_PRESERVE_TEXTURE
66 Normally, every effort is taken to preserve the contents of bit‐
67 maps, since some platforms may forget them. This can take extra
68 processing time. If you know it doesn’t matter if a bitmap
69 keeps its pixel data, for example when it’s a temporary buffer,
70 use this flag to tell Allegro not to attempt to preserve its
71 contents.
72
73 ALLEGRO_ALPHA_TEST
74 This is a driver hint only. It tells the graphics driver to do
75 alpha testing instead of alpha blending on bitmaps created with
76 this flag. Alpha testing is usually faster and preferred if
77 your bitmaps have only one level of alpha (0). This flag is
78 currently not widely implemented (i.e., only for memory bit‐
79 maps).
80
81 ALLEGRO_MIN_LINEAR
82 When drawing a scaled down version of the bitmap, use linear
83 filtering. This usually looks better. You can also combine it
84 with the MIPMAP flag for even better quality.
85
86 ALLEGRO_MAG_LINEAR
87 When drawing a magnified version of a bitmap, use linear filter‐
88 ing. This will cause the picture to get blurry instead of cre‐
89 ating a big rectangle for each pixel. It depends on how you
90 want things to look like whether you want to use this or not.
91
92 ALLEGRO_MIPMAP
93 This can only be used for bitmaps whose width and height is a
94 power of two. In that case, it will generate mipmaps and use
95 them when drawing scaled down versions. For example if the bit‐
96 map is 64x64, then extra bitmaps of sizes 32x32, 16x16, 8x8,
97 4x4, 2x2 and 1x1 will be created always containing a scaled down
98 version of the original.
99
101 al_get_new_bitmap_flags(3), al_get_bitmap_flags(3)
102
103
104
105Allegro reference manual al_set_new_bitmap_flags(3)