logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_RenderPresent - Update the screen with any rendering performed since the previous call.

Availability

       This function is available since SDL 3.2.0.

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.

       Please  note,  that  in case of rendering to a texture - there is noneed to call SDL_RenderPresent after
       drawing needed objects to a texture, and should not be done; you are only required  to  change  back  the
       rendering  target to default via SDL_SetRenderTarget(renderer,NULL) afterwards, as textures by themselves
       do not have a concept of backbuffers. Calling

       SDL_RenderPresent
        while rendering to a texture will still update the screen with any current drawing that  has  been  done
       _to the window itself_.

Function Parameters

renderer
              the rendering context.

Header File

       Defined in SDL3/SDL_render.h

Name

       SDL_RenderPresent - Update the screen with any rendering performed since the previous call.

Return Value

       Returns true on success or false on failure; call

       SDL_GetError () for more information.

See Also

(3),    SDL_CreateRenderer(3),    (3),    SDL_RenderClear(3),    (3),   SDL_RenderFillRect(3),   (3),
       SDL_RenderFillRects(3), (3),  SDL_RenderLine(3),  (3),  SDL_RenderLines(3),  (3),  SDL_RenderPoint(3),
       (3),     SDL_RenderPoints(3),     (3),     SDL_RenderRect(3),     (3),    SDL_RenderRects(3),    (3),
       SDL_SetRenderDrawBlendMode(3), (3), SDL_SetRenderDrawColor(3)

Simple Directmedia Layer                           SDL 3.2.10                               SDL_RenderPresent(3)

Synopsis

#include"SDL3/SDL.h"boolSDL_RenderPresent(SDL_Renderer*renderer);

Thread Safety

       This function should only be called on the main thread.

See Also