Function Surface.convert

Wraps SDL_ConvertPixels which converts the dsdl2.Surface from its RGB(A) dsdl2.PixelFormat to another dsdl2.Surface with a different RGB(A) dsdl2.PixelFormat

Surface convert (
  const(PixelFormat) rgbPixelFormat
) @trusted const;

Parameters

NameDescription
rgbPixelFormat the RGB(A) dsdl2.PixelFormat to target the conversion

Returns

result dsdl2.Surface with the targetPixelFormat

Throws

dsdl2.SDLException if pixels failed to convert