Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
al_use_pr..._transform(3)  Library Functions Manual  al_use_pr..._transform(3)

NAME
       al_use_projection_transform - Allegro 5 API

SYNOPSIS
	      #include <allegro5/allegro.h>

	      void al_use_projection_transform(const ALLEGRO_TRANSFORM *trans)

DESCRIPTION
       Sets  the  projection  transformation to	be used	for the	drawing	opera-
       tions 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:

	      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);

       The  orthographic transformation	above is the default projection	trans-
       form.

       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's	projection transformation will be  re-
       set to default if it is resized.	 Lastly, when you draw a memory	bitmap
       to  a video bitmap with a custom	projection transform, this transforma-
       tion will be ignored (i.e. it'll	be as if the projection	 transform  of
       the target bitmap was temporarily reset to default).

       The  parameter  is  passed by reference as an optimization to avoid the
       overhead	of stack copying.  The reference will not be stored in the Al-
       legro library so	it is safe to pass references to local variables.

SINCE
       5.1.9

SEE ALSO
       al_get_current_projection_transform(3),	  al_perspective_transform(3),
       al_orthographic_transform(3)

Allegro	reference manual			     al_use_pr..._transform(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=al_use_projection_transform&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help