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 When the y-axis is facing downwards (the usual) the filled polygon co‐
31 ordinates must be ordered anti-clockwise. All hole vertices must use
32 the opposite order (clockwise with y down). All hole vertices must be
33 inside the main polygon and no hole may overlap the main polygon.
34
35 For example:
36
37 float vertices[] = {
38 0, 0, // filled polygon, upper left corner
39 0, 100, // filled polygon, lower left corner
40 100, 100, // filled polygon, lower right corner
41 100, 0, // filled polygon, upper right corner
42 10, 10, // hole, upper left
43 90, 10, // hole, upper right
44 90, 90 // hole, lower right
45 };
46 int vertex_counts[] = {
47 4, // number of vertices for filled polygon
48 3, // number of vertices for hole
49 0 // terminator
50 };
51
52 There are 7 vertices: four for an outer square from (0, 0) to (100,
53 100) in anti-clockwise order, and three more for an inner triangle in
54 clockwise order. The outer main polygon uses vertices 0 to 3 (inclu‐
55 sive) and the hole uses vertices 4 to 6 (inclusive).
56
58 5.1.0
59
61 al_draw_filled_polygon(3), al_draw_filled_polygon_with_holes(3),
62 al_triangulate_polygon(3)
63
64
65
66Allegro reference manual al_draw_filled_polygon_with_holes(3)