Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
al_triangulate_polygon(3)  Library Functions Manual  al_triangulate_polygon(3)

NAME
       al_triangulate_polygon -	Allegro	5 API

SYNOPSIS
	      #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)

DESCRIPTION
       Divides a simple	polygon	into triangles,	with zero or more other	simple
       polygons	subtracted from	it - the holes.	 The holes cannot touch	or in-
       tersect with the	outline	of the main polygon.  Simple means the polygon
       does not	have to	be convex but must not be self-overlapping.

       Parameters:

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

        vertex_stride	- distance (in bytes) between successive pairs of ver-
	 tices in the array.

        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.

        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 vertices and	userdata.

        userdata - arbitrary data to be passed	to emit_triangle.

SINCE
       5.1.0

SEE ALSO
       al_draw_filled_polygon_with_holes(3)

Allegro	reference manual			     al_triangulate_polygon(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=al_triangulate_polygon&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help