GPC Polygon Initialization
问题 I am using the GPC Polygon Clipping lib and want to create a polygon programatically. I only see code for how to create one from a file. How can I do the initialization in my code? 回答1: Read better from your link, find the doc page and read; in particular gpc_add_contour function is likely what you need. The struct gpc_vertex_list holds a pointer to gpc_vertex-s and the number of vertex, and is what you must fill in. Like gpc_polygon p = {0, NULL, NULL}; // "void" polygon gpc_vertex v[] = {