int32_t __stdcall gpcAddVertex(IGPC IGPC_, PGPCPolygon Poly, PGPCVertexList VertexList);
function gpcAddVertex(const IGPC_: IGPC; Poly: PGPCPolygon; VertexList: PGPCVertexList): Integer; stdcall;
Purpose. Append one contour (a closed vertex loop) to a caller-owned gpc_polygon structure.
Description. Requires both Poly and VertexList to be non-null and VertexList^.num_vertices > 0 with a non-null vertex array; grows Poly^.contour by one entry via AllocMem and copies the vertex data in verbatim. Memory ownership is explicit and manual: the grown contour array (and each contour's vertex array) is allocated with AllocMem and must be freed by the caller via FreeMem — there is no matching "free one contour" helper in the ABI; freeing happens either contour-by-contour by the caller or, for a gpcClipPoly result polygon, by freeing every Res.contour[i].vertex array and then Res.contour itself.
Parameters.
| Parameter | Description |
|---|---|
IGPC_ | Context handle (unused for any per-call state — see gpcNewGPC). |
Poly | The polygon to grow; caller-owned, must eventually be freed by the caller. |
VertexList | The contour to append (num_vertices + vertex array). |
Return value. 0 on success; -1 if Poly/VertexList is null or VertexList describes zero/no vertices.
See also. gpcClipPoly.
C# (P/Invoke)
public static extern int gpcAddVertex(IntPtr IGPC_, IntPtr Poly, IntPtr VertexList);
Polygon Clipper
gpcAddVertex
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.