al_use_transform(3alleg5)
π al_use_transform β from the al_use_transform(3alleg5) girlies, Allegro 5 API β¨
okay bestie, pull up a chair, we're talking transforms π
β¨ NAME β¨
al_use_transform β the Allegro 5 API function that sets which transformation your drawings are gonna get, no cap π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
void al_use_transform(const ALLEGRO_TRANSFORM *trans)
π¦ DESCRIPTION π¦
so basically, al_use_transform sets the transformation that's gonna be used for the drawing operations on the target bitmap β and here's the tea, every single bitmap keeps its own transformation, they don't share, they're all independent main characters π
Every drawing operation you do after this call is gonna get transformed using this transformation. fr fr. And if you wanna go back to the default behaviour, just call this function with an identity transformation and you're back to normal, periodt π
heads up: this function does absolutely nothing if there is no target bitmap. like, zero. it just vibes. π
Also, the parameter is passed by reference as an optimization β it's there to dodge the overhead of stack copying. And ngl the important part: the reference will not be stored in the Allegro library, so it is totally safe to pass references to local variables. slay π
like, look at this iconic little setup:
void setup_my_transformation(void)
{
ALLEGRO_TRANSFORM transform;
al_translate_transform(&transform, 5, 10);
al_use_transform(&transform);
}
see how transform is a local and we just hand over &transform? that's the vibe check passing with flying colors β¨
Parameters:
transβ Transformation to use π
π SEE ALSO π
go read those too, bestie, they're giving supporting cast energy π«Ά
kisses, this was the Allegro reference manual πβ¨ this page is al_use_transform(3alleg5), you're welcome, mwah ππ¦πΈ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms