toBlendOperation method

BlendOperation toBlendOperation()

Convert from a SDL_BlendOperation member.

Implementation

BlendOperation toBlendOperation() {
  switch (this) {
    case SDL_BlendOperation.SDL_BLENDOPERATION_ADD:
      return BlendOperation.add;
    case SDL_BlendOperation.SDL_BLENDOPERATION_SUBTRACT:
      return BlendOperation.subtract;
    case SDL_BlendOperation.SDL_BLENDOPERATION_REV_SUBTRACT:
      return BlendOperation.revSubtract;
    case SDL_BlendOperation.SDL_BLENDOPERATION_MINIMUM:
      return BlendOperation.minimum;
    case SDL_BlendOperation.SDL_BLENDOPERATION_MAXIMUM:
      return BlendOperation.maximum;
    default:
      throw SdlError(
        this,
        'Unrecognised `SDL_BlendOperation` member.',
      );
  }
}