al_draw_triangle(3alleg5)
π 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<= 0and 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 π
al_draw_filled_triangle(3alleg5)β for when you want the triangle actually filled in, the solid version, the main character version π₯al_draw_soft_triangle(3alleg5)β the software-rendering sibling, also iconic in its own way β
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
- 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