al_draw_triangle(3alleg5)

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

πŸ’– al_draw_triangle πŸ’–

okay bestie, so this one lives in the Allegro 5 API β€” that's the manual we're reading from, the Allegro reference manual, and today's main character is literally just drawing a lil triangle outline. that's it. that's the whole vibe. πŸŽ€


✨ NAME ✨

al_draw_triangle β€” no cap, this is the Allegro 5 API function that draws you an outlined triangle πŸ¦‹


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_primitives.h>

void al_draw_triangle(float x1, float y1, float x2, float y2,
   float x3, float y3, ALLEGRO_COLOR color, float thickness)

like, don't forget that include up top or you're gonna be sitting there confused wondering why nothing compiles. iykyk 😭


πŸ’… DESCRIPTION πŸ’…

So what it does: it draws an outlined triangle. Outline only, bestie β€” the inside stays empty, that's the whole point. if you wanted the filled-in version you're in the wrong place, go check SEE ALSO πŸ’œ

Here's the rundown of what you're passing in:

  • x1, y1, x2, y2, x3, y3 β€” these are your three points of the triangle. three corners, six floats, that's your shape 🫢
  • color β€” the color of the triangle. slay 🌈
  • thickness β€” how thick those lines are gonna be. and here's the tea: pass <= 0 and it draws hairline lines instead ✨
fr fr, that <= 0 thing is not a mistake, it's intentional. hairline mode activated. don't come at me, it's in the docs πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie!! πŸŽ€ courtesy of the Allegro reference manual, filed under al_draw_triangle(3alleg5) β€” go draw some triangles, you got this πŸ’–βœ¨

πŸ“¦ where this page comes from