SDL School

API reference / Windows and drawing

SDL_RenderDebugText

Function, SDL3

Draws a line of text in a built-in font, with no font file. It is for a quick message while you debug.

Declaration

#include <SDL3/SDL.h>

bool SDL_RenderDebugText(SDL_Renderer *renderer, float x, float y, const char *str);

Parameters

rendererThe renderer.
xThe x position of the top-left corner.
yThe y position of the top-left corner.
strThe text.

Return value

True on success. On failure it returns false.

Example

Draw text
SDL_RenderDebugText(renderer, 40.0f, 440.0f, "This line is SDL_RenderDebugText.");

See this code run in Draw text. Download the full program (.zip)

Notes

In SDL2

SDL2 has no such function. Use SDL_ttf.

See also