Esempio n. 1
0
void draw_random_polygon(GP_Pixel pixel)
{
	GP_Coord xy[10];
	int i;

	for (i = 0; i < 5; i++) {
		random_point(win->context, xy + 2*i, xy + 2*i + 1);
	}

	GP_FillPolygon_Raw(win->context, 5, xy, pixel);
}
Esempio n. 2
0
void GP_FillPolygon(GP_Context *context, unsigned int vertex_count,
                    const GP_Coord *xy, GP_Pixel pixel)
{
	unsigned int i;
	GP_Coord xy_copy[2 * vertex_count];

	for (i = 0; i < vertex_count; i++) {
		unsigned int x = 2 * i;
		unsigned int y = 2 * i + 1;

		xy_copy[x] = xy[x];
		xy_copy[y] = xy[y];
		GP_TRANSFORM_POINT(context, xy_copy[x], xy_copy[y]);
	}

	GP_FillPolygon_Raw(context, vertex_count, xy_copy, pixel);
}