File: al_use_projection_transform.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 (61 lines) | stat: -rw-r--r-- 1,988 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
.TH "al_use_projection_transform" "3" "" "Allegro reference manual" ""
.SH NAME
.PP
al_use_projection_transform \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <allegro5/allegro.h>

void\ al_use_projection_transform(const\ ALLEGRO_TRANSFORM\ *trans)
\f[]
.fi
.SH DESCRIPTION
.PP
Sets the projection transformation to be used for the the drawing
operations on the target bitmap (each bitmap maintains its own
projection transformation).
Every drawing operation after this call will be transformed using this
transformation.
To return default behavior, call this function with an orthographic
transform like so:
.IP
.nf
\f[C]
ALLEGRO_TRANSFORM\ trans;
al_identity_transform(&trans);
al_orthographic_transform(&trans,\ 0,\ 0,\ \-1.0,\ al_get_bitmap_width(bitmap),
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ al_get_bitmap_height(bitmap),\ 1.0);

al_set_target_bitmap(bitmap);
al_use_projection_transform(&trans);
\f[]
.fi
.PP
The orthographic transformation above is the default projection
transform.
.PP
This function does nothing if there is no target bitmap.
This function also does nothing if the bitmap is a memory bitmap (i.e.
memory bitmaps always use an orthographic transform like the snippet
above).
Note that the projection transform will be reset to default if a video
bitmap is converted to a memory bitmap.
Additionally, if the bitmap in question is the backbuffer, it\[aq]s
projection transformation will be reset to default if it is resized.
Lastly, when you draw a memory bitmap to a video bitmap with a custom
projection transform, this transformation will be ignored (i.e.
it\[aq]ll be as if the projection transform of the target bitmap was
temporarily reset to default).
.PP
The parameter is passed by reference as an optimization to avoid the
overhead of stack copying.
The reference will not be stored in the Allegro library so it is safe to
pass references to local variables.
.SH SINCE
.PP
5.1.9
.SH SEE ALSO
.PP
al_get_current_projection_transform(3)