TTF_GPUTEXTENGINEWINDING(3type)

πŸ’… NAME πŸ’…

TTF_GPUTextEngineWinding β€” the winding order of the vertices returned by TTF_GetGPUTextDrawData

okay so bestie, imagine you're drawing text with a GPU and you gotta know which way the lil vertex triangles are spinning. that's this. that's the whole vibe. it tells you the winding order, periodt.


πŸŽ€ HEADER FILE πŸŽ€

it lives in SDL3_ttf/SDL_ttf.h, no cap. that's the file you gotta pull in.


✨ SYNOPSIS ✨

#include "SDL3_ttf/SDL_ttf.h"

typedef enum TTF_GPUTextEngineWinding
{
    TTF_GPU_TEXTENGINE_WINDING_INVALID = -1,
    TTF_GPU_TEXTENGINE_WINDING_CLOCKWISE,
    TTF_GPU_TEXTENGINE_WINDING_COUNTER_CLOCKWISE
} TTF_GPUTextEngineWinding;

so we got three options here, and lemme introduce them like they're characters in a show:

  • TTF_GPU_TEXTENGINE_WINDING_INVALID β€” set to -1, and it's giving "something went wrong, this is not it." the invalid one. the red flag 🚩
  • TTF_GPU_TEXTENGINE_WINDING_CLOCKWISE β€” vertices go around clockwise. spinny to the right, slay πŸ’«
  • TTF_GPU_TEXTENGINE_WINDING_COUNTER_CLOCKWISE β€” vertices go around counter-clockwise. spinny to the left, also iconic πŸ’«

fr fr, that's the whole enum. no hidden members, no extra lore.


🌈 AVAILABILITY 🌈

this enum has been around since SDL_ttf 3.0.0. so it's not new-new, it's been serving looks for a minute. πŸ‘‘


ngl bestie, the winding order matters when you're feeding vertices into a GPU pipeline, cause different APIs and cull modes care about which way the triangles face. get it wrong and your text just… disappears. not me crying over invisible glyphs 😭 so like, check the winding, always.

and that's the tea πŸ“ this page was brought to you by SDL_ttf 3.2.2 β€” go forth and wind those vertices correctly, you absolute main character 🫢✨

πŸ“¦ where this page comes from