TTF_Destroy...erTextEngine(3)

πŸ’– TTF_Destroy...erTextEngine(3) πŸ’–

okay bestie, quick vibe check: this page lives in the SDL_ttf3 FUNCTIONS section of the manual, and it's the lil cleanup ritual for your renderer text engine. no cap, it's short but it MATTERS. πŸŽ€


✨ NAME ✨

TTF_DestroyRendererTextEngine β€” destroy a text engine created for drawing text on an SDL renderer. πŸ—‘οΈβœ¨


πŸ“ HEADER FILE πŸ“

defined in SDL3_ttf/SDL_ttf.h β€” yeah she lives in there, go get her πŸ¦‹


🌸 SYNOPSIS 🌸

#include "SDL3_ttf/SDL_ttf.h"

void TTF_DestroyRendererTextEngine(TTF_TextEngine *engine);

like, that's the whole signature. simple. iconic. πŸ’…


πŸ’« DESCRIPTION πŸ’«

so here's the tea β˜• β€” all text created by this engine should be destroyed before calling this function. that's it, that's the rule. clean up your text first, then yeet the engine. not the other way around, bestie, please πŸ™ˆ


🫢 FUNCTION PARAMETERS 🫢

  • engine β€” a TTF_TextEngine object created with TTF_CreateRendererTextEngine(). yes, that one. the one you made earlier. you can't just roll up with some random pointer, okay? 😭

🧡 THREAD SAFETY 🧡

this function should be called on the thread that created the engine. same thread, same energy, no crossing streams. periodt. πŸ‘‘


⭐ AVAILABILITY ⭐

this function is available since SDL_ttf 3.0.0. so if you're on anything older... girl, upgrade. πŸ“


πŸ‘€ SEE ALSO πŸ‘€

go read that one too, iykyk πŸ’œ


and that's the whole page, bestie!! you ate that cleanup arc fr fr πŸ’–

this lil gem comes to you courtesy of SDL_ttf 3.2.2 β€” mwah, thanks for reading, ily, go destroy some engines (the text ones, responsibly) πŸ§šβœ¨πŸŽ€

πŸ“¦ where this page comes from