SDL_RenderReadPixels

Read pixels from the current rendering target.

The returned surface should be freed with SDL_DestroySurface.

**WARNING**: This is a very slow operation, and should not be used frequently. If you're using this on the main rendering target, it should be called after rendering and before SDL_RenderPresent.

extern (C) nothrow @nogc extern
SDL_RenderReadPixels

Parameters

renderer SDL_Renderer*

The rendering context.

rect const(SDL_Rect)*

An SDL_Rect structure representing the area in pixels relative to the to current viewport, or null for the entire viewport.

Return Value

A new SDL_Surface on success or null on failure; call SDL_GetError for more information.

Threadsafety: This function should only be called on the main thread.

Meta