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
renderer | The renderer. |
x | The x position of the top-left corner. |
y | The y position of the top-left corner. |
str | The text. |
Return value
True on success. On failure it returns false.
Example
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
- Each character is 8 by 8 pixels, and only ASCII characters appear.
In SDL2
SDL2 has no such function. Use SDL_ttf.