1al_use_projection_transform(3)                  al_use_projection_transform(3)
2
3
4

NAME

6       al_use_projection_transform - Allegro 5 API
7

SYNOPSIS

9              #include <allegro5/allegro.h>
10
11              void al_use_projection_transform(const ALLEGRO_TRANSFORM *trans)
12

DESCRIPTION

14       Sets the projection transformation to be used for the the drawing oper‐
15       ations on the target bitmap (each bitmap maintains its  own  projection
16       transformation).   Every  drawing  operation  after  this  call will be
17       transformed using this transformation.   To  return  default  behavior,
18       call this function with an orthographic transform like so:
19
20              ALLEGRO_TRANSFORM trans;
21              al_identity_transform(&trans);
22              al_orthographic_transform(&trans, 0, 0, -1.0, al_get_bitmap_width(bitmap),
23                                        al_get_bitmap_height(bitmap), 1.0);
24
25              al_set_target_bitmap(bitmap);
26              al_use_projection_transform(&trans);
27
28       The  orthographic transformation above is the default projection trans‐
29       form.
30
31       This function does nothing if there is no target bitmap.  This function
32       also  does  nothing if the bitmap is a memory bitmap (i.e.  memory bit‐
33       maps always use an orthographic  transform  like  the  snippet  above).
34       Note  that the projection transform will be reset to default if a video
35       bitmap is converted to a memory bitmap.  Additionally, if the bitmap in
36       question  is  the  backbuffer,  it's  projection transformation will be
37       reset to default if it is resized.  Lastly, when you draw a memory bit‐
38       map  to  a video bitmap with a custom projection transform, this trans‐
39       formation will be ignored (i.e.  it'll be as if the  projection  trans‐
40       form of the target bitmap was temporarily reset to default).
41
42       The  parameter  is  passed by reference as an optimization to avoid the
43       overhead of stack copying.  The reference will not  be  stored  in  the
44       Allegro library so it is safe to pass references to local variables.
45

SINCE

47       5.1.9
48

SEE ALSO

50       al_get_current_projection_transform(3)
51
52
53
54Allegro reference manual                        al_use_projection_transform(3)
Impressum