SDL Wiki
(This is the legacy documentation for stable SDL2, the current stable version; SDL3 is the current development version.)

SDL_CreateRenderer

Create a 2D rendering context for a window.

Syntax

SDL_Renderer * SDL_CreateRenderer(SDL_Window * window,
                       int index, Uint32 flags);

Function Parameters

window

the window where rendering is displayed

index

the index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags

flags

0, or one or more SDL_RendererFlags OR'd together

Return Value

Returns a valid rendering context or NULL if there was an error; call SDL_GetError() for more information.

Version

This function is available since SDL 2.0.0.

SDL_CreateSoftwareRenderer
SDL_DestroyRenderer
SDL_GetNumRenderDrivers
SDL_GetRendererInfo

CategoryAPI


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.