polygon(3alleg4)

πŸ’– NAME πŸ’–

polygon β€” draws a filled polygon, bestie. This is from the Allegro manual, aka the Allegro game programming library, and the manual tag is polygon(3alleg4). Periodt. πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void polygon(BITMAP *bmp, int vertices, const int *points, int color);

✨ DESCRIPTION ✨

Okay so polygon draws a filled polygon with an arbitrary number of corners. No cap, it just does. πŸ¦‹

You pass the number of vertices and an array containing a series of x, y points β€” a total of vertices*2 values. The way that math works is lowkey iconic. ✨

Example, fr fr:

int points[12] = { 50, 50,   100, 100,  100, 150,
                   50, 200,  0,   150,  0,   100 };
...
clear_to_color(screen, makecol(255, 255, 255));
polygon(screen, 6, points, makecol(0, 0, 0));

🌈 SEE ALSO 🌈


That's the whole page, bestie. Go draw something cute. Signed off by Allegro version 4.4.3 and the tag polygon(3alleg4). πŸŽ€βœ¨πŸ’–