SDL School

API reference / Windows and drawing

SDL_RenderClear

Function, SDL3

Fills the full hidden picture with the current draw color. Most programs call this first in each frame.

Declaration

#include <SDL3/SDL.h>

bool SDL_RenderClear(SDL_Renderer *renderer);

Parameters

rendererThe renderer.

Return value

True on success. On failure it returns false.

Example

Open a window
SDL_RenderClear(renderer);

See this code run in Open a window. Download the full program (.zip)

In SDL2

The name is the same.

See also