TTF_CreateG...thProperties(3)

πŸ’– TTF_CreateGPUTextEngineWithProperties(3) πŸ’–

okay bestie, so we're deep in the SDL_ttf3 function zone, and this one is giving "I make text engines for the GPU" ✨ It's TTF_CreateGPUTextEngineWithProperties, and yes the title is truncated with ... because Unix manpage titles have a character budget and honestly, same. 🫢


🌸 NAME 🌸

TTF_CreateGPUTextEngineWithProperties β€” Create a text engine for drawing text with the SDL GPU API, with the specified properties. periodt πŸ’…


πŸŽ€ HEADER FILE πŸŽ€

Defined in SDL3_ttf/SDL_ttf.h β€” that's the one you're gonna #include, no cap.


✨ SYNOPSIS ✨

#include "SDL3_ttf/SDL_ttf.h"

TTF_TextEngine * TTF_CreateGPUTextEngineWithProperties(SDL_PropertiesID props);

#define TTF_PROP_GPU_TEXT_ENGINE_DEVICE                   SDL_ttf.gpu_text_engine.create.device"
#define TTF_PROP_GPU_TEXT_ENGINE_ATLAS_TEXTURE_SIZE       SDL_ttf.gpu_text_engine.create.atlas_texture_size"

Like, look at those two macros. They're the whole vibe check for this function. 🌈


πŸ’œ DESCRIPTION πŸ’œ

So these are the supported properties, and bestie, there are exactly two:

  • TTF_PROP_GPU_TEXT_ENGINE_DEVICE β€” the SDL_GPUDevice you wanna use for creating textures and drawing text. This is your main character. πŸ‘‘
  • TTF_PROP_GPU_TEXT_ENGINE_ATLAS_TEXTURE_SIZE β€” the size of the texture atlas. Big atlas, big energy.

πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • props β€” the properties to use. That's it, that's the whole list, she's low maintenance. πŸ“

πŸ’€ RETURN VALUE πŸ’€

Returns a TTF_TextEngine object... or NULL on failure 😭 and if that happens you gotta call SDL_GetError() for more information. Not me manifesting a non-NULL return for you tho πŸ™ˆβœ¨


🧚 THREAD SAFETY 🧚

This function should be called on the thread that created the device. Like, don't be messy about it β€” same thread, same energy, no side quests. πŸ”₯


⭐ AVAILABILITY ⭐

This function is available since SDL_ttf 3.0.0. She's been here, she's established, she ate. πŸ’…


🌈 SEE ALSO 🌈

iykyk πŸ‘‘


SDL_ttf β€” SDL_ttf 3.2.2 β€” mwah, that's a wrap bestie, go make something iconic with your GPU text engine πŸŽ€πŸ’–πŸ«Ά

πŸ“¦ where this page comes from