SDL_CreateRenderer

Create a 2D rendering context for a window.

If you want a specific renderer, you can specify its name here. A list of available renderers can be obtained by calling SDL_GetRenderDriver multiple times, with indices from 0 to SDL_GetNumRenderDrivers() - 1. If you don't need a specific renderer, specify null and SDL will attempt to choose the best option for you, based on what is available on the user's system.

If name is a comma-separated list, SDL will try each name, in the order listed, until one succeeds or all of them fail.

By default the rendering size matches the window size in pixels, but you can call SDL_SetRenderLogicalPresentation to change the content size and scaling options.

extern (C) nothrow @nogc extern
SDL_CreateRenderer
(,
const(char)* name
)

Parameters

window SDL_Window*

The window where rendering is displayed.

name const(char)*

The name of the rendering driver to initialize, or null to let SDL choose one.

Return Value

A valid rendering context or null if there was an error; call SDL_GetError for more information.

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

See Also

Meta