File: al_set_new_bitmap_flags.3

package info (click to toggle)
allegro5 2%3A5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,032 kB
  • sloc: ansic: 120,340; cpp: 15,707; objc: 4,805; python: 2,915; java: 2,195; sh: 887; xml: 86; makefile: 49; perl: 37; pascal: 24
file content (123 lines) | stat: -rw-r--r-- 3,783 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.TH "al_set_new_bitmap_flags" "3" "" "Allegro reference manual" ""
.SH NAME
.PP
al_set_new_bitmap_flags \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <allegro5/allegro.h>

void\ al_set_new_bitmap_flags(int\ flags)
\f[]
.fi
.SH DESCRIPTION
.PP
Sets the flags to use for newly created bitmaps.
Valid flags are:
.TP
.B ALLEGRO_MEMORY_BITMAP
Create a bitmap residing in system memory.
Operations on, and with, memory bitmaps will not be hardware
accelerated.
However, direct pixel access can be relatively quick compared to video
bitmaps, which depend on the display driver in use.
.RS
.PP
\f[I]Note\f[]: Allegro\[aq]s software rendering routines are currently
very unoptimised.
.RE
.TP
.B ALLEGRO_VIDEO_BITMAP
Creates a bitmap that resides in the video card memory.
These types of bitmaps receive the greatest benefit from hardware
acceleration.
.RS
.PP
\f[I]Note\f[]: Creating a video bitmap will fail if there is no current
display or the current display driver cannot create the bitmap.
The latter will happen if for example the format or dimensions are not
supported.
.PP
\f[I]Note:\f[] Bitmaps created with this flag will be converted to
memory bitmaps when the last display is destroyed.
In most cases it is therefore easier to use the ALLEGRO_CONVERT_BITMAP
flag instead.
.RE
.TP
.B ALLEGRO_CONVERT_BITMAP
This is the default.
It will try to create a video bitmap and if that fails create a memory
bitmap.
Bitmaps created with this flag when there is no active display will be
converted to video bitmaps next time a display is created.
They also will remain video bitmaps if the last display is destroyed and
then another is created again.
Since 5.1.0.
.RS
.PP
\f[I]Note:\f[] You can combine this flag with ALLEGRO_MEMORY_BITMAP or
ALLEGRO_VIDEO_BITMAP to force the initial type (and fail in the latter
case if no video bitmap can be created) \- but usually neither of those
combinations is very useful.
.PP
You can use the display option ALLEGRO_AUTO_CONVERT_BITMAPS to control
which displays will try to auto\-convert bitmaps.
.RE
.TP
.B ALLEGRO_FORCE_LOCKING
Does nothing since 5.1.8.
Kept for backwards compatibility only.
.RS
.RE
.TP
.B ALLEGRO_NO_PRESERVE_TEXTURE
Normally, every effort is taken to preserve the contents of bitmaps,
since some platforms may forget them.
This can take extra processing time.
If you know it doesn\[aq]t matter if a bitmap keeps its pixel data, for
example when it\[aq]s a temporary buffer, use this flag to tell Allegro
not to attempt to preserve its contents.
.RS
.RE
.TP
.B ALLEGRO_ALPHA_TEST
This is a driver hint only.
It tells the graphics driver to do alpha testing instead of alpha
blending on bitmaps created with this flag.
Alpha testing is usually faster and preferred if your bitmaps have only
one level of alpha (0).
This flag is currently not widely implemented (i.e., only for memory
bitmaps).
.RS
.RE
.TP
.B ALLEGRO_MIN_LINEAR
When drawing a scaled down version of the bitmap, use linear filtering.
This usually looks better.
You can also combine it with the MIPMAP flag for even better quality.
.RS
.RE
.TP
.B ALLEGRO_MAG_LINEAR
When drawing a magnified version of a bitmap, use linear filtering.
This will cause the picture to get blurry instead of creating a big
rectangle for each pixel.
It depends on how you want things to look like whether you want to use
this or not.
.RS
.RE
.TP
.B ALLEGRO_MIPMAP
This can only be used for bitmaps whose width and height is a power of
two.
In that case, it will generate mipmaps and use them when drawing scaled
down versions.
For example if the bitmap is 64x64, then extra bitmaps of sizes 32x32,
16x16, 8x8, 4x4, 2x2 and 1x1 will be created always containing a scaled
down version of the original.
.RS
.RE
.SH SEE ALSO
.PP
al_get_new_bitmap_flags(3), al_get_bitmap_flags(3)