al_draw_rotated_bitmap(3)
π al_draw_rotated_bitmap π
okay so this little icon is straight out of the Allegro 5 API, living in the Library Functions Manual β and bestie, it's giving βrotate the bitmap, slay the canvasβ energy β¨
πΈ NAME πΈ
al_draw_rotated_bitmap β Allegro 5 API π
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
void al_draw_rotated_bitmap(ALLEGRO_BITMAP *bitmap,
float cx, float cy, float dx, float dy, float angle, int flags)
π DESCRIPTION π
So this one draws a rotated version of the given bitmap to the target bitmap. The bitmap is rotated by angle radians clockwise. Periodt. π₯
The point at cx/cy relative to the upper left corner of the bitmap will be drawn at dx/dy, and the bitmap is rotated around this point. If cx,cy is 0,0, the bitmap will rotate around its upper left corner. No cap, that's the whole rotation vibe check π
cxβ center x (relative to the bitmap) π―cyβ center y (relative to the bitmap) π―dxβ destination x πdyβ destination y πangleβ angle by which to rotate (radians) πflagsβ same as foral_draw_bitmap(3)π©
π¦ Example π¦
float w = al_get_bitmap_width(bitmap);
float h = al_get_bitmap_height(bitmap);
al_draw_rotated_bitmap(bitmap, w / 2, h / 2, x, y, ALLEGRO_PI / 2, 0);
The above code draws the bitmap centered on x/y and rotates it 90Β° clockwise. Iconic behavior honestly π
Lowkey important: see al_draw_bitmap(3) for a note on restrictions on which bitmaps can be drawn where. Don't skip the fine print, bestie π
π SEE ALSO π
al_draw_bitmap(3)al_draw_bitmap_region(3)al_draw_scaled_bitmap(3)al_draw_scaled_rotated_bitmap(3)
shoutout to the Allegro reference manual for the source/version line at the bottom β and the footer's date slot is literally blank, so no date to report, bestie π«Άπ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms