Drawing shapesSDL 3.2
SDL_RenderPresent
Shows the finished frame on screen. Nothing you drew is visible before this call.
Signature
bool SDL_RenderPresent(SDL_Renderer *renderer);
How it works
All drawing goes to a hidden back buffer. Present swaps it onto the screen in one go, so the viewer never sees a half-drawn frame. With vsync on (SDL_SetRenderVSync) it waits for the monitor's refresh.
Afterwards treat the back buffer as garbage: clear it before drawing the next frame, never draw "on top of last frame".
Parameters
rendererSDL_Renderer *
The renderer.
Return value
true on success, false on failure.
Tips & pitfalls
Call it with the window as the target (
SDL_SetRenderTarget(renderer, NULL)), not while drawing into a texture.
Example
example.cpp
1SDL_RenderClear(renderer);
2drawEverything(renderer);
3SDL_RenderPresent(renderer); // one per frame