TTF_CREATERENDERERTEXTENGINEWITHPROPERTIES(3)

πŸ’– NAME πŸ’–

TTF_CreateRendererTextEngineWithProperties β€” bestie, this is the one that creates a text engine for drawing text on an SDL renderer, and you get to hand it a lil' bag of properties to customize it. So it's the "make me a text engine, but my way" function. ✨


πŸŽ€ HEADER FILE πŸŽ€

It lives in SDL3_ttf/SDL_ttf.h, okurrr.

🌸 SYNOPSIS 🌸

#include "SDL3_ttf/SDL_ttf.h"

TTF_TextEngine * TTF_CreateRendererTextEngineWithProperties(SDL_PropertiesID props);

#define TTF_PROP_RENDERER_TEXT_ENGINE_RENDERER                 SDL_ttf.renderer_text_engine.create.renderer"
#define TTF_PROP_RENDERER_TEXT_ENGINE_ATLAS_TEXTURE_SIZE       SDL_ttf.renderer_text_engine.create.atlas_texture_size"

Yes those two #defines are property-name macros and yes you pass them through props. Iconic behavior honestly.


✨ DESCRIPTION ✨

Okay so here's the tea β˜• β€” these are the properties that are supported:

  • TTF_PROP_RENDERER_TEXT_ENGINE_RENDERER β€” the renderer you wanna use for creating textures and drawing text. Like, the actual SDL renderer. Required vibes-wise, obviously.
  • TTF_PROP_RENDERER_TEXT_ENGINE_ATLAS_TEXTURE_SIZE β€” the size of the texture atlas. Yes bestie, there's an atlas. It's a texture atlas. It holds your glyphs. πŸ¦‹

🫢 FUNCTION PARAMETERS 🫢

  • props β€” the properties to use. That's it. That's the whole arg. Slay.

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns a TTF_TextEngine object on success, or NULL on failure. And when it fails? Call SDL_GetError() for more info, because we do NOT do mystery errors in this house. πŸ’…


πŸ’€ THREAD SAFETY πŸ’€

Not me having to say this, but: this function should be called on the thread that created the renderer. Same thread, bestie. Don't get cute with it. πŸ™ˆ


🌈 AVAILABILITY 🌈

This function has been available since SDL_ttf 3.0.0. So if you're on something older... it's giving vintage, and not in the good way. 😭


⭐ SEE ALSO ⭐


And that's the whole page, fr fr. This gem comes to you courtesy of SDL_ttf, version 3.2.2 β€” go forth and render some text, you absolute main character. πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from