---
name: "al_draw_filled_polygon_with_holes"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_draw_filled_polygon_with_holes"
---

# al\_draw\_filled\_polygon\_with\_holes(3)

Allegro 5 API

## NAME

al\_draw\_filled\_polygon\_with\_holes - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_primitives.h>
  void al_draw_filled_polygon_with_holes(const float *vertices,
     const int *vertex_counts, ALLEGRO_COLOR color)
  ```

## DESCRIPTION

Draws a filled simple polygon with zero or more other simple polygons subtracted from it - the holes. The holes cannot touch or intersect with the outline of the filled polygon.

- •

  vertices - Interleaved array of (x, y) vertex coordinates for each of the polygons, including holes.

- •

  vertex\_counts - Number of vertices for each polygon. The number of vertices in the filled 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.

- •

  color - Color of the filled polygon

When the y-axis is facing downwards (the usual) the filled polygon coordinates must be ordered anti-clockwise. All hole vertices must use the opposite order (clockwise with y down). All hole vertices must be inside the main polygon and no hole may overlap the main polygon.

For example:

-

  ```
  float vertices[] = {
        0,   0, // filled polygon, upper left corner
        0, 100, // filled polygon, lower left corner
      100, 100, // filled polygon, lower right corner
      100,   0, // filled polygon, upper right corner
       10,  10, // hole, upper left
       90,  10, // hole, upper right
       90,  90  // hole, lower right
  };
  int vertex_counts[] = {
     4, // number of vertices for filled polygon
     3, // number of vertices for hole
     0  // terminator
  };
  ```

There are 7 vertices: four for an outer square from (0, 0) to (100, 100) in anti-clockwise order, and three more for an inner triangle in clockwise order. The outer main polygon uses vertices 0 to 3 (inclusive) and the hole uses vertices 4 to 6 (inclusive).

## SINCE

5\.1.0

## SEE ALSO

[al\_draw\_filled\_polygon(3)](/al_draw_filled_polygon/3.md), [al\_draw\_filled\_polygon\_with\_holes(3)](/al_draw_filled_polygon_with_holes/3.md), [al\_triangulate\_polygon(3)](/al_triangulate_polygon/3.md)
