al_triangulate_polygon(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’– al_triangulate_polygon(3) β€” Library Functions Manual πŸ’–

🌸 NAME 🌸

okay so al_triangulate_polygon β€” Allegro 5 API. That's the name, bestie, and this is literally its whole manual moment. periodt. πŸ’…


✨ SYNOPSIS ✨

#include <allegro5/allegro_primitives.h>

bool al_triangulate_polygon(
   const float* vertices, size_t vertex_stride, const int* vertex_counts,
   void (*emit_triangle)(int, int, int, void*), void* userdata)

πŸ¦‹ DESCRIPTION πŸ¦‹

bestie, this one divides a simple polygon into triangles, with zero or more other simple polygons subtracted from it β€” the holes. The holes cannot touch or intersect with the outline of the main polygon. Simple means the polygon does not have to be convex but must not be self-overlapping.

🚨 caveat check: holes cannot touch or intersect with the outline of the main polygon, and the polygon must not be self-overlapping. no cap, that part matters. πŸ’€

πŸ’… Parameters πŸ’…

  • vertices β€” an interleaved array of (x, y) vertex coordinates for each of the polygons, including holes. πŸ’–
  • vertex_stride β€” the distance (in bytes) between successive pairs of vertices in the array. πŸ¦‹
  • vertex_counts β€” number of vertices for each polygon. The number of vertices in the main polygon is given by vertex_counts[0] and must be at least three. Subsequent elements indicate the number of vertices in each hole. The array must be terminated with an element with value zero. πŸ‘‘
  • emit_triangle β€” a function to be called for every set of three points that form a triangle. The function is passed the indices of the points in vertices and userdata. πŸ”₯
  • userdata β€” arbitrary data to be passed to emit_triangle. πŸŽ€

πŸ”₯ SINCE πŸ”₯

5.1.0 ✨ β€” that's the version, bestie. it's been giving since 5.1.0, fr fr.


🌈 SEE ALSO 🌈

al_draw_filled_polygon_with_holes(3) β€” go read that one too, bestie. iykyk. 🫢


β€” Allegro reference manual Β· Allegro 5 API Β· al_triangulate_polygon(3) Β· date? not printed in this footer, so don't come for me πŸ™ˆπŸ’–

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms