aapolygonRgba function
Implementation
int aapolygonRgba(Pointer<SdlRenderer> renderer, Pointer<Int16> vx,
Pointer<Int16> vy, int n, int r, int g, int b, int a) {
int result;
int i;
/*
* Vertex array NULL check
*/
if (vx == nullptr) {
return (-1);
}
if (vy == nullptr) {
return (-1);
}
/*
* Sanity check
*/
if (n < 3) {
return (-1);
}
/*
* Pointer setup
*/
/*
* Draw
*/
result = 0;
for (i = 1; i < n; i++) {
result |= _aalineRgba(
renderer, vx[i - 1], vy[i - 1], vx[i], vy[i], r, g, b, a, 0);
}
result |=
_aalineRgba(renderer, vx[n - 1], vy[n - 1], vx[0], vy[0], r, g, b, a, 0);
return (result);
}