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_FlushRenderer - Force the rendering context to flush any pending commands and state.

Availability

       This function is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                               SDL_FlushRenderer(3)

Description

       You  do  not  need  to  (and  in fact, shouldn't) call this function unless you are planning to call into
       OpenGL/Direct3D/Metal/whatever directly, in addition to using an SDL_Renderer .

       This is  for  a  very-specific  case:  if  you  are  using  SDL's  render  API,  and  you  plan  to  make
       OpenGL/D3D/whatever  calls  in  addition  to  SDL render API calls. If this applies, you should call this
       function between calls to SDL's render API and the low-level API you're using in cooperation.

       In all other cases, you can ignore this function.

       This call makes SDL flush any pending rendering work it was queueing up to do later in  a  single  batch,
       and marks any internal cached state as invalid, so it'll prepare all its state again later, from scratch.

       This  means  you  do  not need to save state in your rendering code to protect the SDL renderer. However,
       there lots of arbitrary pieces of Direct3D and OpenGL state that can confuse things; you should use  your
       best judgment and be prepared to make changes if specific state needs to be protected.

Function Parameters

renderer
              the rendering context.

Header File

       Defined in SDL3/SDL_render.h

Name

       SDL_FlushRenderer - Force the rendering context to flush any pending commands and state.

Return Value

       Returns true on success or false on failure; call

       SDL_GetError () for more information.

Synopsis

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

Thread Safety

       This function should only be called on the main thread.

See Also