al_draw_polygon(3alleg5)

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

πŸ’– al_draw_polygon β€” Allegro 5 API πŸ’–

okay bestie, pull up a chair, we're talking about al_draw_polygon from the Allegro 5 API (manual page al_draw_polygon(3alleg5), section 3alleg5, Allegro reference manual energy). it's giving shapes. it's giving outlines. let's go πŸ¦‹


✨ SYNOPSIS ✨

#include <allegro5/allegro_primitives.h>

void al_draw_polygon(const float *vertices, int vertex_count,
   int join_style, ALLEGRO_COLOR color, float thickness, float miter_limit)

like yes, six whole arguments, she's high maintenance but she serves πŸ’…


🌸 DESCRIPTION 🌸

so basically: this draws an unfilled polygon. outline only. no filling, no shading, just the vibes of a shape. and here's the tea β€” it's literally the same thing as passing ALLEGRO_LINE_CAP_CLOSED to al_draw_polyline(3alleg5). same girl, different name. periodt. πŸ‘‘

here's the rundown of what you're handing her:

  • vertex β€” an interleaved array of (x, y) vertex coordinates. interleaved!! so it's like x, y, x, y, x, y all cozy next to each other, not two separate arrays. don't do that to her. πŸ™ˆ
  • vertex_count β€” how many vertices are actually in that array, bestie. count them. accurately. πŸ‘€
  • join_style β€” a member of ALLEGRO_LINE_JOIN(3alleg5), and it tells her how to render the joins between line segments. this is the corner-shape department. πŸŽ€
  • color β€” the color of the line. make it cute. or make it menacing. your call, main character. 🌈
  • thickness β€” thickness of the line. and listen: pass <= 0 to draw hairline lines. zero or negative, that's the hairline zone, skinny legend behaviour. ✨
  • miter_limit β€” the parameter for the miter join style. it exists because miter joins are dramatic and need boundaries. ⭐

πŸ•°οΈ SINCE πŸ•°οΈ

5.1.0 β€” she's been here since 5.1.0, an icon from the start 🫢


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie πŸ’– this came straight out of the Allegro reference manual, page al_draw_polygon(3alleg5) β€” no date on the tag, just vibes and a version line. go draw something iconic. mwah. πŸ˜­πŸ’…

πŸ“¦ where this page comes from