copy method

int copy(
  1. Pointer<SdlTexture> texture, {
  2. Rectangle<double>? srcrect,
  3. Rectangle<double>? dstrect,
})

Implementation

int copy(Pointer<SdlTexture> texture,
    {math.Rectangle<double>? srcrect, math.Rectangle<double>? dstrect}) {
  Pointer<SdlRect> srcrectPointer = nullptr;
  Pointer<SdlRect> dstrectPointer = nullptr;
  if (srcrect != null) {
    srcrectPointer = srcrect.calloc();
  }
  if (dstrect != null) {
    dstrectPointer = dstrect.calloc();
  }
  // 1829
  var result = sdlRenderCopy(this, texture, srcrectPointer, dstrectPointer);
  calloc.free(srcrectPointer);
  calloc.free(dstrectPointer);
  return result;
}