al_draw_spline(3alleg5)

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

πŸ’– al_draw_spline πŸ’–

ok so bestie, this is a page from the allegro5 manual β€” yes, the Allegro 5 API πŸ’… like, the whole lib. and today's main character is al_draw_spline, which is lowkey iconic for reasons we're about to get into. grab a strawberry πŸ“ and let's go.


✨ NAME ✨

al_draw_spline β€” Allegro 5 API

like. that's it. that's the name. it draws splines, no cap.


🌈 SYNOPSIS 🌈

#include <allegro5/allegro_primitives.h>

void al_draw_spline(const float points[8], ALLEGRO_COLOR color, float thickness)

so you gotta #include the primitives header first, periodt. no header, no spline, that's the vibe check. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

it draws a Bézier spline given 4 control points. that's the whole gig. four points walk in, one smooth curvy line walks out. it's giving glow-up ✨

ngl a BΓ©zier spline is that smooth swoopy curve you see in fancy graphics editors, and you only need 4 control points to define it here. the way that 4 little coordinate pairs can make something that pretty? obsessed. πŸ’œ

Parameters, bestie, one by one:

  • points β€” an array of 4 pairs of coordinates of the 4 control points. so that's 8 floats total, which is why the signature says points[8] β€” 4 points Γ— 2 coords each. math ate that fr fr. πŸ”₯
  • color β€” color of the spline. an ALLEGRO_COLOR, obviously, because this is Allegro and we stay on brand. 🎨
  • thickness β€” thickness of the spline. and here's the tea: pass <= 0 and it draws a hairline spline instead. zero or negative? boom, hairline. that's the whole rule, don't overthink it. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie!! 🫢 this was the Allegro reference manual talking to you, wrapping up the al_draw_spline(3alleg5) era. go forth and draw something curvy. slay. πŸ’–πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from