File: al_create_bitmap.3

package info (click to toggle)
allegro5 2%3A5.0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,856 kB
  • ctags: 15,948
  • sloc: ansic: 87,540; cpp: 9,693; objc: 3,491; python: 2,057; sh: 829; makefile: 93; perl: 37; pascal: 24
file content (47 lines) | stat: -rw-r--r-- 1,724 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
.TH al_create_bitmap 3 "" "Allegro reference manual"
.SH NAME
.PP
al_create_bitmap \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <allegro5/allegro.h>

ALLEGRO_BITMAP\ *al_create_bitmap(int\ w,\ int\ h)
\f[]
.fi
.SH DESCRIPTION
.PP
Creates a new bitmap using the bitmap format and flags for the current
thread.
Blitting between bitmaps of differing formats, or blitting between
memory bitmaps and display bitmaps may be slow.
.PP
Unless you set the ALLEGRO_MEMORY_BITMAP flag, the bitmap is created for
the current display.
Blitting to another display may be slow.
.PP
If a display bitmap is created, there may be limitations on the allowed
dimensions.
For example a DirectX or OpenGL backend usually has a maximum allowed
texture size \- so if bitmap creation fails for very large dimensions,
you may want to re\-try with a smaller bitmap.
Some platforms also dictate a minimum texture size, which is relevant if
you plan to use this bitmap with the primitives addon.
If you try to create a bitmap smaller than this, this call will not fail
but the returned bitmap will be a section of a larger bitmap with the
minimum size.
The minimum size that will work on all platforms is 32 by 32.
.PP
Some platforms do not directly support display bitmaps whose dimensions
are not powers of two.
Allegro handles this by creating a larger bitmap that has dimensions
that are powers of two and then returning a section of that bitmap with
the dimensions you requested.
This can be relevant if you plan to use this bitmap with the primitives
addon but shouldn\[aq]t be an issue otherwise.
.SH SEE ALSO
.PP
al_set_new_bitmap_format(3), al_set_new_bitmap_flags(3),
al_clone_bitmap(3), al_create_sub_bitmap(3), al_destroy_bitmap(3)