table of contents
SDL_RenderPresent(3) | SDL3 FUNCTIONS | SDL_RenderPresent(3) |
NAME¶
SDL_RenderPresent - Update the screen with any rendering performed since the previous call.
HEADER FILE¶
Defined in SDL3/SDL_render.h
SYNOPSIS¶
#include "SDL3/SDL.h"
int SDL_RenderPresent(SDL_Renderer *renderer);
DESCRIPTION¶
SDL's rendering functions operate on a backbuffer; that is, calling a rendering function such as SDL_RenderLine () does not directly put a line on the screen, but rather updates the backbuffer. As such, you compose your entire scene and present the composed backbuffer to the screen as a complete picture.
Therefore, when using SDL's rendering API, one does all drawing intended for the frame, and then calls this function once per frame to present the final drawing to the user.
The backbuffer should be considered invalidated after each present; do not assume that previous contents will exist between frames. You are strongly encouraged to call SDL_RenderClear () to initialize the backbuffer before starting each new frame's drawing, even if you plan to overwrite every pixel.
FUNCTION PARAMETERS¶
- renderer
- the rendering context
RETURN VALUE¶
Returns 0 on success or a negative error code on failure; call
SDL_GetError () for more information.
THREAD SAFETY¶
You may only call this function on the main thread.
AVAILABILITY¶
This function is available since SDL 3.0.0.
SEE ALSO¶
SDL_RenderClear(3), SDL_RenderLine(3), SDL_RenderLines(3), SDL_RenderPoint(3), SDL_RenderPoints(3), SDL_RenderRect(3), SDL_RenderRects(3), SDL_RenderFillRect(3), SDL_RenderFillRects(3), SDL_SetRenderDrawBlendMode(3), SDL_SetRenderDrawColor(3)
SDL 3.1.2 | Simple Directmedia Layer |