File: al_triangulate_polygon.3

package info (click to toggle)
allegro5 2%3A5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,032 kB
  • sloc: ansic: 120,340; cpp: 15,707; objc: 4,805; python: 2,915; java: 2,195; sh: 887; xml: 86; makefile: 49; perl: 37; pascal: 24
file content (50 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.TH "al_triangulate_polygon" "3" "" "Allegro reference manual" ""
.SH NAME
.PP
al_triangulate_polygon \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <allegro5/allegro_primitives.h>

bool\ al_triangulate_polygon(
\ \ \ const\ float*\ vertices,\ size_t\ vertex_stride,\ const\ int*\ vertex_counts,
\ \ \ void\ (*emit_triangle)(int,\ int,\ int,\ void*),\ void*\ userdata)
\f[]
.fi
.SH DESCRIPTION
.PP
Divides a simple polygon into triangles, with zero or more other simple
polygons subtracted from it \- the holes.
The holes cannot touch or intersect with the outline of the main
polygon.
Simple means the polygon does not have to be convex but must not be
self\-overlapping.
.PP
\f[I]Parameters:\f[]
.IP \[bu] 2
vertices \- Interleaved array of (x, y) vertex coordinates for each of
the polygons, including holes.
.IP \[bu] 2
vertex_stride \- distance (in bytes) between successive pairs of
vertices in the array.
.IP \[bu] 2
vertex_counts \- Number of vertices for each polygon.
The number of vertices in the main 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.
.IP \[bu] 2
emit_triangle \- a function to be called for every set of three points
that form a triangle.
The function is passed the indices of the points in \f[C]vertices\f[]
and \f[C]userdata\f[].
.IP \[bu] 2
userdata \- arbitrary data to be passed to emit_triangle.
.SH SINCE
.PP
5.1.0
.SH SEE ALSO
.PP
al_draw_filled_polygon_with_holes(3)