|
Returns the first patch that is attached to the given polygon.
If the given polygon is a patch in itself then the function will return NULL.
To check whether a polygon is a patch or not, use STATE_polygon_get_patch_type()
See also STATE_polygon_get_patch_father.
Example
here is how to make a function that counts how many patches are attached to a given polygon
int count_patches(DWORD polygon_handle)
{
int count=0;
check_patch=STATE_polygon_get_patch_type(polygon_handle);
if(check_patch!=0) {
MessageBox("The given polygon is a patch in itself !
return(-1); instead we could do polygon_handle=STATE_polygon_get_patch_father(polygon_handle);
and continue normal execution of the function
}
for(DWORD poly=STATE_polygon_get_first_patch(polygon_handle); poly!=NULL; poly=STATE_polygon_get_next_patch(poly) )
count++;
return(count);
}
|