polygonRgba function
Implementation
bool polygonRgba(Pointer<SdlRenderer> renderer, Pointer<Int16> vx,
Pointer<Int16> vy, int n, int r, int g, int b, int a) {
/*
* Draw
*/
bool 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, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
}
if (result) {
result = sdlSetRenderDrawColor(renderer, r, g, b, a);
}
/*
* Draw
*/
if (result) {
result = polygon(renderer, vx, vy, n);
}
return result;
}