Renderer.readPixels

Wraps SDL_RenderReadPixels which makes a dsdl2.Surface from a specified dsdl2.Rect boundary at the renderer's target

  1. Surface readPixels(PixelFormat format)
  2. Surface readPixels(Rect rect, PixelFormat format)
    class Renderer
    const @trusted
    readPixels

Parameters

rect Rect

dsdl2.Rect boundary to be read and copied

format PixelFormat

requested dsdl2.PixelFormat of the returned dsdl2.Surface

Return Value

Type: Surface

dsdl2.Surface copy of the specified rectangle boundary in the renderer's target

Throws

dsdl2.SDLException if pixels failed to be read

Meta