do_ellipse(3)
β¨ do_ellipse β NAME β¨
ok so do_ellipse is the girl who calculates all the points in an ellipse π
and she lives in the Allegro game programming library. bestie she is so good at her job.
πΈ SYNOPSIS πΈ
#include <allegro.h>
void do_ellipse(BITMAP *bmp, int x, int y, int rx, ry, int d, void
(*proc)(BITMAP *bmp, int x, int y, int d));
yes the ry has no int in front of it, that's canon, do not perceive it, we don't fix the source material around here π
π¦ DESCRIPTION π¦
Okay so here's the tea π« β do_ellipse walks every single point on an ellipse that's hanging out around the point (x, y), with radius rx and radius ry (yes, two different radii, it's giving oval, she's not a circle, she's got range π). And for each one of those points, she calls the function you handed her.
That function gets passed:
- a copy of the
bmpparameter π - the
xandyposition of the point - a copy of the
dparameter
which means it's literally perfect for use with putpixel(). iykyk β¨
Example time, watch her cook:
void draw_explosion_ring(BITMAP *bmp, int x, int y, int d)
{
...
}
do_ellipse(screen, SCREEN_W/2, SCREEN_H/2,
SCREEN_H/16, SCREEN_H/32, flame_color,
draw_explosion_ring);
ok note thatdis whatever you want it to be β a colour, a thickness, a vibe βdo_ellipsedoes not care, she just passes it straight through to your callback. she's a courier, not a critic π
π SEE ALSO π
the whole friend group fr fr π«Ά go say hi.
mwah π this has been your girl from the Allegro manual, version 4.4.3 β stan do_ellipse(3), she ate and left no crumbs πβ¨π
π¦ 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