al_draw_filled_polygon(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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