Function sdl2_sys::SDL_RenderPresent
source · pub unsafe extern "C" fn SDL_RenderPresent(
renderer: *mut SDL_Renderer,
)
Expand description
Update the screen with any rendering performed since the previous call.
SDL’s rendering functions operate on a backbuffer; that is, calling a rendering function such as SDL_RenderDrawLine() 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.
\param renderer the rendering context
\since This function is available since SDL 2.0.0.
\sa SDL_RenderClear \sa SDL_RenderDrawLine \sa SDL_RenderDrawLines \sa SDL_RenderDrawPoint \sa SDL_RenderDrawPoints \sa SDL_RenderDrawRect \sa SDL_RenderDrawRects \sa SDL_RenderFillRect \sa SDL_RenderFillRects \sa SDL_SetRenderDrawBlendMode \sa SDL_SetRenderDrawColor