lineRgba function

bool lineRgba(
  1. Pointer<SdlRenderer> renderer,
  2. double x1,
  3. double y1,
  4. double x2,
  5. double y2,
  6. int r,
  7. int g,
  8. int b,
  9. int a,
)

Implementation

bool lineRgba(Pointer<SdlRenderer> renderer, double x1, double y1, double x2,
    double y2, int r, int g, int b, int a) {
  /*
	* Draw
	*/
  bool result = true;
  if (result) {
    result = sdlSetRenderDrawBlendMode(
        renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
  }
  if (result) {
    result = sdlSetRenderDrawColor(renderer, r, g, b, a);
  }
  if (result) {
    result = sdlRenderLine(renderer, x1, y1, x2, y2);
  }
  return result;
}