al_draw_polyline(3)

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

🌸 NAME 🌸

al_draw_polyline β€” Allegro 5 API. This is page al_draw_polyline(3) from the Library Functions Manual, and she's here to draw a series of line segments for you, bestie. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

              #include <allegro5/allegro_primitives.h>

              void al_draw_polyline(const float* vertices, int vertex_stride,
                 int vertex_count, int join_style, int cap_style,
                 ALLEGRO_COLOR color, float thickness, float miter_limit)

πŸ’– DESCRIPTION πŸ’–

Okay so the whole vibe: draw a series of line segments. That's the main character energy. πŸŽ€

Here's the cast of parameters, and yes every single one matters:

  • vertices β€” interleaved array of (x, y) vertex coordinates. Cute little coordinate pairs living their best life together.
  • vertex_stride β€” the number of bytes between pairs of vertices (the stride). Yes, bytes. She's measuring the gap, not the drip. πŸ’…
  • vertex_count β€” number of vertices in the array.
  • join_style β€” member of ALLEGRO_LINE_JOIN(3) specifying how to render the joins between line segments.
  • cap_style β€” member of ALLEGRO_LINE_CAP(3) specifying how to render the end caps.
  • color β€” color of the line.
  • thickness β€” thickness of the line, pass <= 0 to draw hairline lines. Hairline is giving ✨delicate✨.
  • miter_limit β€” parameter for miter join style.

The stride is normally 2 * sizeof(float) but may be more if the vertex coordinates are in an array of some structure type, e.g.:

              struct VertexInfo {
                 float x;
                 float y;
                 int id;
              };

              void my_draw(struct VertexInfo verts[], int vertex_count, ALLEGRO_COLOR c)
              {
                 al_draw_polyline((float *)verts, sizeof(VertexInfo), vertex_count,
                    ALLEGRO_LINE_JOIN_NONE, ALLEGRO_LINE_CAP_NONE, c, 1.0, 1.0);
              }

The stride may also be negative if the vertices are stored in reverse order. Not me learning that and gasping 😭 β€” but fr fr, it's allowed.

⭐ SINCE ⭐

5.1.0 β€” she's been iconic since then. πŸ‘‘

🌈 SEE ALSO 🌈


mwah πŸ’‹ β€” source/version: Allegro reference manual Β· date: not listed on the page Β· footer page: al_draw_polyline(3). That's the whole tea, bestie. πŸ“

πŸ“¦ 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