al_draw_polyline(3)
πΈ 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 ofALLEGRO_LINE_JOIN(3)specifying how to render the joins between line segments.cap_styleβ member ofALLEGRO_LINE_CAP(3)specifying how to render the end caps.colorβ color of the line.thicknessβ thickness of the line, pass<= 0to 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