GrAPiC
Graphics for Algo/Prog in C/C++

◆ polygonFill()

void grapic::polygonFill ( int  p[][2],
unsigned int  number 
)

Draw a simple(no edge-crossing) and without holes filled polygon.

Parameters
p[]: array of integer which represent the coordinate of each vertices
number: number of element in p[], must be even (point are two integers each)!
Warning
Draw nothing if there are not enough vertices or if number is not even
Undetermined draw if the polygon is not simple (Code provided by Bastien DOIGNIES, many thanks)
int p[4][2];
p[0][0] = 20; p[0][1] = 20; // sommet 0, coord X et Y
p[1][0] = 200; p[1][1] = 20; // sommet 1, coord X et Y
p[2][0] = 200; p[2][1] = 200; // sommet 2, coord X et Y
p[3][0] = 20; p[3][1] = 200; // sommet 3, coord X et Y
void polygonFill(int p[][2], unsigned int number)
Draw a simple(no edge-crossing) and without holes filled polygon.