1al_draw_filled_polygon_with_holes(3) al_draw_filled_polygon_with_holes(3)
2
3
4
6 al_draw_filled_polygon_with_holes - Allegro 5 API
7
9 #include <allegro5/allegro_primitives.h>
10
11 void al_draw_filled_polygon_with_holes(const float *vertices,
12 const int *vertex_counts, ALLEGRO_COLOR color)
13
15 Draws a filled simple polygon with zero or more other simple polygons
16 subtracted from it - the holes. The holes cannot touch or intersect
17 with the outline of the filled polygon.
18
19 · vertices - Interleaved array of (x, y) vertex coordinates for each of
20 the polygons, including holes.
21
22 · vertex_counts - Number of vertices for each polygon. The number of
23 vertices in the filled polygon is given by vertex_counts[0] and must
24 be at least three. Subsequent elements indicate the number of ver‐
25 tices in each hole. The array must be terminated with an element
26 with value zero.
27
28 · color - Color of the filled polygon
29
30 All hole vertices must use the opposite order (clockwise with y down)
31 of the polygon vertices. All hole vertices must be inside the main
32 polygon and no hole may overlap the main polygon.
33
34 For example:
35
36 float vertices[] = {
37 0, 0, // filled polygon, upper left corner
38 0, 100, // filled polygon, lower left corner
39 100, 100, // filled polygon, lower right corner
40 100, 0, // filled polygon, upper right corner
41 10, 10, // hole, upper left
42 90, 10, // hole, upper right
43 90, 90 // hole, lower right
44 };
45 int vertex_counts[] = {
46 4, // number of vertices for filled polygon
47 3, // number of vertices for hole
48 0 // terminator
49 };
50
51 There are 7 vertices: four for an outer square from (0, 0) to (100,
52 100) in anti-clockwise order, and three more for an inner triangle in
53 clockwise order. The outer main polygon uses vertices 0 to 3 (inclu‐
54 sive) and the hole uses vertices 4 to 6 (inclusive).
55
57 5.1.0
58
60 al_draw_filled_polygon(3), al_draw_filled_polygon_with_holes(3),
61 al_triangulate_polygon(3)
62
63
64
65Allegro reference manual al_draw_filled_polygon_with_holes(3)