Function Surface.convert

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

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

Parameters

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

Returns

result dsdl.Surface with the targetPixelFormat

Throws

dsdl.SDLException if pixels failed to convert