---
name: "SDL_RenderDebugText"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_RenderDebugText"
---

# SDL\_RenderDebugText(3)

Draw debug text to an SDL\_Renderer .

## NAME

SDL\_RenderDebugText - Draw debug text to an  **SDL\_Renderer** .

## HEADER FILE

Defined in SDL3/SDL\_render.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_RenderDebugText(SDL\_Renderer \*renderer, float x, float y, const char \*str);**

## DESCRIPTION

This function will render a string of text to an

**SDL\_Renderer** . Note that this is a convenience function for debugging, with severe limitations, and not intended to be used for production apps and games.

Among these limitations:

• It accepts UTF-8 strings, but will only renders ASCII characters.

• It has a single, tiny size (8x8 pixels). One can use logical presentation\
   or scaling to adjust it, but it will be blurry.

• It uses a simple, hardcoded bitmap font. It does not allow different font\
   selections and it does not support truetype, for proper scaling.

• It does no word-wrapping and does not treat newline characters as a line\
   break. If the text goes out of the window, it's gone.

For serious text rendering, there are several good options, such as

**SDL\_ttf** , stb\_truetype, or other external libraries.

On first use, this will create an internal texture for rendering glyphs. This texture will live until the renderer is destroyed.

The text is drawn in the color specified by

**SDL\_SetRenderDrawColor** ().

## FUNCTION PARAMETERS

- *renderer*

  the renderer which should draw a line of text.

- *x*

  the x coordinate where the top-left corner of the text will draw.

- *y*

  the y coordinate where the top-left corner of the text will draw.

- *str*

  the string to render.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

This function should only be called on the main thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_RenderDebugTextFormat**(3)](/SDL_RenderDebugTextFormat/3.md), **•**(3), [**SDL\_DEBUG\_TEXT\_FONT\_CHARACTER\_SIZE**(3)](/SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE/3.md)
