-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0751a1
commit 8b59893
Showing
4 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 [<SDL3_ttf/SDL_ttf.h>](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) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 [<SDL3_ttf/SDL_ttf.h>](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) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 [<SDL3_ttf/SDL_ttf.h>](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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 [<SDL3_ttf/SDL_ttf.h>](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) | ||