---
name: "polygon"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/polygon"
---

# polygon(3alleg)

Draws a filled polygon. Allegro game programming library.

## NAME

polygon - Draws a filled polygon. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

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

## DESCRIPTION

Draws a filled polygon with an arbitrary number of corners. Pass the  number of vertices and an array containing a series of x, y points (a  total of vertices\*2 values). Example:

```
   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

[**triangle**(3alleg)](/triangle/3alleg.md), [**polygon3d**(3alleg)](/polygon3d/3alleg.md), [**drawing\_mode**(3alleg)](/drawing_mode/3alleg.md), [**makecol**(3alleg)](/makecol/3alleg.md), [**excamera**(3alleg)](/excamera/3alleg.md)
