polygonRgba function
Implementation
bool polygonRgba(
Pointer<SdlRenderer> renderer,
Pointer<Int16> vx,
Pointer<Int16> vy,
int n,
int r,
int g,
int b,
int a, {
int blendMode = SDL_BLENDMODE_BLEND,
}) {
/*
* Draw
*/
var result = true;
/*
* Vertex array NULL check
*/
if (vx == nullptr) {
return false;
}
if (vy == nullptr) {
return false;
}
/*
* Sanity check
*/
if (n < 3) {
return false;
}
/*
* Pointer setup
*/
/*
* Set color
*/
result = true;
if (result) {
result = sdlSetRenderDrawBlendMode(renderer, blendMode);
}
if (result) {
result = sdlSetRenderDrawColor(renderer, r, g, b, a);
}
/*
* Draw
*/
if (result) {
result = polygon(renderer, vx, vy, n);
}
return result;
}