al_draw_filled_polygon(3alleg5)
π al_draw_filled_polygon π
okay bestie, welcome to the Allegro 5 API β yes, the one and only. this page is about al_draw_filled_polygon, and it's literally the moment your polygon gets a whole outfit instead of just an outline. slay.
β¨ SYNOPSIS β¨
#include <allegro5/allegro_primitives.h>
void al_draw_filled_polygon(const float *vertices, int vertex_count,
ALLEGRO_COLOR color)
πΈ DESCRIPTION πΈ
so. you wanna draw a filled, simple polygon. and "simple" here is not a compliment about its personality β it means the shape does not have to be convex (so it can be all curvy and chaotic, that's fine), but it must not be self-overlapping. no crossing your own edges, babe. that's the rule.
the parameters, one by one, because we don't gatekeep:
verticesβ interleaved array of(x, y)vertex coordinates. yes, x then y then x then y, living their best interleaved life. π¦vertex_countβ number of vertices in the array. how many little points you're feeding it.colorβ color of the filled polygon. the fit. the lewk. π
ok now the important one, no cap: when the y-axis is facing downwards (which is the usual case, the standard vibe), the coordinates must be ordered anti-clockwise. don't do it clockwise, bestie, that's not the move.
β SINCE β
5.1.0 β so it's been iconic for a minute.
π SEE ALSO π
and that's the whole page, periodt. π this was the Allegro reference manual doing its thing, so if you see it floating around, that's where it's from. go draw something gorgeous. π«Άπ
π¦ 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