al_draw_rectangle(3alleg5)

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

✨ al_draw_rectangle ✨

okay bestie, so this one lives in the Allegro 5 API (that's the 3alleg5 manual, iykyk) and it's about to become your new fave little line-drawing icon πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_primitives.h>

void al_draw_rectangle(float x1, float y1, float x2, float y2,
   ALLEGRO_COLOR color, float thickness)

πŸ¦‹ DESCRIPTION πŸ¦‹

It draws an outlined rectangle. That's it, that's the whole vibe β€” just the border, no fill, like eyeliner for your shapes ✨

Now the parameters, because we love a breakdown:

  • x1, y1, x2, y2 β€” these are the upper left and lower right points of the rectangle. Yes, two corners, that's all it needs, she's low maintenance πŸŽ€
  • color β€” the color of the rectangle. Go off, pick something cute 🌈
  • thickness β€” the thickness of the lines. And listen: if you pass a value <= 0, you get hairline lines. Hairline!! So thin, so delicate, so demure 🧚
no cap, <= 0 really does mean hairline β€” don't come for me, that's just what it does πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the tea, bestie 🫢 this page came straight out of the Allegro reference manual, filed under al_draw_rectangle(3alleg5). go draw something iconic, periodt πŸ’–πŸŒΈβœ¨

πŸ“¦ where this page comes from