SDL_RenderDebugTextFormat(3)

πŸ’– SDL_RenderDebugTextFormat(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one is literally called SDL_RenderDebugTextFormat and it's giving "quick and dirty debug text but make it printf" ✨


🌸 NAME 🌸

SDL_RenderDebugTextFormat β€” draws debug text onto an SDL_Renderer. that's it, that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_render.h>

bool SDL_RenderDebugTextFormat(SDL_Renderer *renderer, float x, float y, const char *fmt, ...);

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this function does is render a printf()-style format string straight to a renderer. cute right? 🫢

BUT β€” and I need you to hear me on this one β€” this is a convenience function for debugging, it has severe limitations, and it is not intended to be used for production apps and games. no cap. do not ship this. πŸ™ˆ

if you want the full list of limitations and other useful info, go read SDL_RenderDebugText. it's all there, iykyk πŸ‘‘


πŸ’… FUNCTION PARAMETERS πŸ’…

  • renderer β€” the renderer that should draw the text. she's the main character, she does the drawing 🎨
  • 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 πŸ“ (yes bestie, same deal, just the other axis)
  • fmt β€” the format string to draw ✍️
  • ... β€” the additional parameters matching % tokens in the fmt string, if there are any. only if any. periodt πŸ’œ

🌈 RETURN VALUE 🌈

returns true on success or false on failure. if it fails, call SDL_GetError() for more info β€” she will tell you what went wrong, fr fr 😭


🧚 THREAD SAFETY 🧚

this function should only be called on the main thread. don't be out here passing it around to your other threads, that's not the move πŸ’€


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0 πŸ“


πŸ”₯ SEE ALSO πŸ”₯


k bye bestie, go draw some debug text, just don't put it in prod 🫢

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_RenderDebugTextFormat(3) ✨ that's the source, the version and the date, mwah, slay, no notes πŸ’–

πŸ“¦ where this page comes from