polygonRgba function
Implementation
int polygonRgba(Pointer<SdlRenderer> renderer, Pointer<Int16> vx,
Pointer<Int16> vy, int n, int r, int g, int b, int a) {
/*
* Draw
*/
int result;
/*
* Vertex array NULL check
*/
if (vx == nullptr) {
return (-1);
}
if (vy == nullptr) {
return (-1);
}
/*
* Sanity check
*/
if (n < 3) {
return (-1);
}
/*
* Pointer setup
*/
/*
* Set color
*/
result = 0;
result |= sdlSetRenderDrawBlendMode(
renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
result |= sdlSetRenderDrawColor(renderer, r, g, b, a);
/*
* Draw
*/
result |= polygon(renderer, vx, vy, n);
return (result);
}