From 8b598937127f64b45cddcea043bc78a3e6a6bec1 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 7 Dec 2024 15:36:52 +0000 Subject: [PATCH] Sync SDL3_ttf header -> wiki --- SDL3_ttf/TTF_CreateGPUTextEngine.md | 42 ++++++++++++++++++++++ SDL3_ttf/TTF_DestroyGPUTextEngine.md | 41 +++++++++++++++++++++ SDL3_ttf/TTF_GPUAtlasDrawSequence.md | 38 ++++++++++++++++++++ SDL3_ttf/TTF_GetGPUTextDrawData.md | 53 ++++++++++++++++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 SDL3_ttf/TTF_CreateGPUTextEngine.md create mode 100644 SDL3_ttf/TTF_DestroyGPUTextEngine.md create mode 100644 SDL3_ttf/TTF_GPUAtlasDrawSequence.md create mode 100644 SDL3_ttf/TTF_GetGPUTextDrawData.md diff --git a/SDL3_ttf/TTF_CreateGPUTextEngine.md b/SDL3_ttf/TTF_CreateGPUTextEngine.md new file mode 100644 index 000000000..57c473faf --- /dev/null +++ b/SDL3_ttf/TTF_CreateGPUTextEngine.md @@ -0,0 +1,42 @@ +###### (This function is part of SDL_ttf, a separate library from SDL.) +# TTF_CreateGPUTextEngine + +Create a text engine for drawing text with the SDL GPU API. + +## Header File + +Defined in [](https://github.com/libsdl-org/SDL_ttf/blob/main/include/SDL3_ttf/SDL_ttf.h) + +## Syntax + +```c +TTF_TextEngine * TTF_CreateGPUTextEngine(SDL_GPUDevice *device); +``` + +## Function Parameters + +| | | | +| --------------- | ---------- | ---------------------------------------------------------------- | +| SDL_GPUDevice * | **device** | the SDL_GPUDevice to use for creating textures and drawing text. | + +## Return Value + +([TTF_TextEngine](TTF_TextEngine) *) Returns a +[TTF_TextEngine](TTF_TextEngine) object or NULL on failure; call +SDL_GetError() for more information. + +## Thread Safety + +This function should be called on the thread that created the device. + +## Version + +This function is available since SDL_ttf 3.0.0. + +## See Also + +- [TTF_DestroyGPUTextEngine](TTF_DestroyGPUTextEngine) + +---- +[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction) + diff --git a/SDL3_ttf/TTF_DestroyGPUTextEngine.md b/SDL3_ttf/TTF_DestroyGPUTextEngine.md new file mode 100644 index 000000000..cfef27ade --- /dev/null +++ b/SDL3_ttf/TTF_DestroyGPUTextEngine.md @@ -0,0 +1,41 @@ +###### (This function is part of SDL_ttf, a separate library from SDL.) +# TTF_DestroyGPUTextEngine + +Destroy a text engine created for drawing text with the SDL GPU API. + +## Header File + +Defined in [](https://github.com/libsdl-org/SDL_ttf/blob/main/include/SDL3_ttf/SDL_ttf.h) + +## Syntax + +```c +void TTF_DestroyGPUTextEngine(TTF_TextEngine *engine); +``` + +## Function Parameters + +| | | | +| ---------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------ | +| [TTF_TextEngine](TTF_TextEngine) * | **engine** | a [TTF_TextEngine](TTF_TextEngine) object created with [TTF_CreateGPUTextEngine](TTF_CreateGPUTextEngine)(). | + +## Remarks + +All text created by this engine should be destroyed before calling this +function. + +## Thread Safety + +This function should be called on the thread that created the engine. + +## Version + +This function is available since SDL_ttf 3.0.0. + +## See Also + +- [TTF_CreateGPUTextEngine](TTF_CreateGPUTextEngine) + +---- +[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction) + diff --git a/SDL3_ttf/TTF_GPUAtlasDrawSequence.md b/SDL3_ttf/TTF_GPUAtlasDrawSequence.md new file mode 100644 index 000000000..1361d1e99 --- /dev/null +++ b/SDL3_ttf/TTF_GPUAtlasDrawSequence.md @@ -0,0 +1,38 @@ +###### (This function is part of SDL_ttf, a separate library from SDL.) +# TTF_GPUAtlasDrawSequence + +Draw sequence returned by [TTF_GetGPUTextDrawData](TTF_GetGPUTextDrawData) + +## Header File + +Defined in [](https://github.com/libsdl-org/SDL_ttf/blob/main/include/SDL3_ttf/SDL_ttf.h) + +## Syntax + +```c +typedef struct TTF_GPUAtlasDrawSequence +{ + SDL_GPUTexture *atlas_texture; /**< Texture atlas that stores the glyphs */ + float *xy; /**< Vertex positions */ + int xy_stride; /**< Byte size to move from one element to the next element */ + float *uv; /**< Vertex normalized texture coordinates */ + int uv_stride; /**< Byte size to move from one element to the next element */ + int num_vertices; /**< Number of vertices */ + int *indices; /**< An array of indices into the 'vertices' arrays */ + int num_indices; /**< Number of indices */ + + struct TTF_GPUAtlasDrawSequence *next; /**< The next sequence (will be NULL in case of the last sequence) */ +} TTF_GPUAtlasDrawSequence; +``` + +## Version + +This struct is available since SDL_ttf 3.0.0. + +## See Also + +- [TTF_GetGPUTextDrawData](TTF_GetGPUTextDrawData) + +---- +[CategoryAPI](CategoryAPI), [CategoryAPIStruct](CategoryAPIStruct) + diff --git a/SDL3_ttf/TTF_GetGPUTextDrawData.md b/SDL3_ttf/TTF_GetGPUTextDrawData.md new file mode 100644 index 000000000..ccd701ae5 --- /dev/null +++ b/SDL3_ttf/TTF_GetGPUTextDrawData.md @@ -0,0 +1,53 @@ +###### (This function is part of SDL_ttf, a separate library from SDL.) +# TTF_GetGPUTextDrawData + +Get the geometry data needed for drawing the text. + +## Header File + +Defined in [](https://github.com/libsdl-org/SDL_ttf/blob/main/include/SDL3_ttf/SDL_ttf.h) + +## Syntax + +```c +TTF_GPUAtlasDrawSequence* TTF_GetGPUTextDrawData(TTF_Text *text); +``` + +## Function Parameters + +| | | | +| ---------------------- | -------- | ----------------- | +| [TTF_Text](TTF_Text) * | **text** | the text to draw. | + +## Return Value + +([TTF_GPUAtlasDrawSequence](TTF_GPUAtlasDrawSequence) *) Returns a NULL +terminated linked list of +[TTF_GPUAtlasDrawSequence](TTF_GPUAtlasDrawSequence) objects or NULL if the +passed text is empty or in case of failure; call SDL_GetError() for more +information. + +## Remarks + +`text` must have been created using a [TTF_TextEngine](TTF_TextEngine) from +[TTF_CreateGPUTextEngine](TTF_CreateGPUTextEngine)(). + +If the text looks blocky use linear filtering. + +## Thread Safety + +This function should be called on the thread that created the text. + +## Version + +This function is available since SDL_ttf 3.0.0. + +## See Also + +- [TTF_CreateGPUTextEngine](TTF_CreateGPUTextEngine) +- [TTF_CreateText](TTF_CreateText) +- [TTF_CreateText_Wrapped](TTF_CreateText_Wrapped) + +---- +[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction) +