do_circle(3)
π do_circle(3) π
okay bestie, welcome to the Allegro manual, and today's main character is do_circle β she calculates all the points in a circle, and she does it for the Allegro game programming library. no cap. π¦
β¨ SYNOPSIS β¨
#include <allegro.h>
void do_circle(BITMAP *bmp, int x, int y, int radius, int d, void
(*proc)(BITMAP *bmp, int x, int y, int d));
πΈ DESCRIPTION πΈ
so the way this works is iconic: do_circle calculates all the points in a circle around the point (x, y) with radius r, and then it calls the function you handed it for each and every one of those points. like, every single one. she's thorough. π
That supplied function gets passed a copy of the bmp parameter, the x and y position, and a copy of the d parameter β which means it's perfectly set up to be used with putpixel(). obsessed, honestly. π
Example, since I know you want one:
void draw_explosion_ring(BITMAP *bmp, int x, int y, int d)
{
...
}
do_circle(screen, SCREEN_W/2, SCREEN_H/2,
SCREEN_H/16, flame_color,
draw_explosion_ring);
like?? that's it. that's the whole vibe. π₯
π SEE ALSO π
and that's a wrap, bestie π«Ά this was Allegro version 4.4.3, and yeah, it's giving do_circle(3) energy from start to finish. go draw a circle. slay. β¨π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms