Wiki Page Content

Differences between revisions 24 and 25
Revision 24 as of 2011-02-15 19:18:55
Size: 1253
Editor: SheenaSmith
Comment: update content - 2/14 changeset 5295 (as of 5145); moved to render.h
Revision 25 as of 2011-02-16 18:54:39
Size: 1228
Editor: SheenaSmith
Comment: update content - 2/16 changeset 5318 (as of 5147)
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Use this function to create and make active a 2D rendering context for a window. Use this function to create a 2D rendering context for a window.
Line 11: Line 11:
int SDL_CreateRenderer(SDL_Window* window, SDL_Renderer* SDL_CreateRenderer(SDL_Window* window,
Line 22: Line 22:
Returns 0 on success or a negative error code on failure; call [[SDL_GetError]]() for more information. Returns a valid rendering context or NULL if there was an error; call [[SDL_GetError]]() for more information.
Line 37: Line 37:
 .[[SDL_SelectRenderer]]

SDL_CreateRenderer

Use this function to 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; see Remarks for details

Return Value

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

Code Examples

You can add your code example here

Remarks

flags may be any of the following OR'd together:

SDL_RENDERER_SOFTWARE

the renderer is a software fallback

SDL_RENDERER_ACCELERATED

the renderer uses hardware acceleration

SDL_RENDERER_PRESENTVSYNC

present is synchronized with the refresh rate

SDL_RENDERER_TARGETTEXTURE

the renderer supports rendering to texture

Note that providing no flags gives priority to available SDL_RENDERER_ACCELERATED renderers.


CategoryAPI, CategoryRender

None: SDL_CreateRenderer (last edited 2014-11-11 02:06:24 by RyanGordon)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit