SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
SDL::TextEngineRef Struct Reference

A text engine used to create text objects. More...

Inheritance diagram for SDL::TextEngineRef:
Inheritance graph
[legend]

Public Member Functions

void SetGPUWinding (GPUTextEngineWinding winding)
 Sets the winding order of the vertices returned by TextRef.GetGPUDrawData for a particular GPU text engine.
 
GPUTextEngineWinding GetGPUWinding () const
 Get the winding order of the vertices returned by TextRef.GetGPUDrawData for a particular GPU text engine.
 
constexpr Resource (T resource={})
 Constructs from the underlying resource.
 
constexpr Resource (const ResourceHandle< Resource< T > > auto &resource)
 Constructs from pointer like.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
- Public Member Functions inherited from SDL::Resource< TTF_TextEngine * >
constexpr Resource (TTF_TextEngine * resource={})
 Constructs from the underlying resource.
 
constexpr Resource (const ResourceHandle< Resource< TTF_TextEngine * > > auto &resource)
 Constructs from pointer like.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
constexpr operator bool () const
 True if contains a valid resource.
 
constexpr operator value_type () const
 Converts back to underlying type.
 
constexpr bool operator== (const Resource &other) const=default
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr TTF_TextEngine * get () const
 Return contained resource;.
 
constexpr const TTF_TextEngine * operator-> () const
 Access to fields.
 
constexpr TTF_TextEngine * operator-> ()
 Access to fields.
 

Static Public Member Functions

static void DestroySurface (TTF_TextEngine *engine)
 Destroy a text engine created for drawing text on SDL surfaces.
 
static void DestroyRenderer (TTF_TextEngine *engine)
 Destroy a text engine created for drawing text on an SDL renderer.
 
static void DestroyGPU (TTF_TextEngine *engine)
 Destroy a text engine created for drawing text with the SDL GPU API.
 

Additional Inherited Members

- Public Types inherited from SDL::Resource< TTF_TextEngine * >
using value_type = TTF_TextEngine *
 The raw resource type.
 

Detailed Description

This is a public interface that can be used by applications and libraries to perform customize rendering with text objects. See <SDL3_ttf/SDL_textengine.h> for details.

There are three text engines provided with the library:

Since
This struct is available since SDL_ttf 3.0.0.
Category:
Resource
See also
TextEngine

Member Function Documentation

◆ DestroyGPU()

static void SDL::TextEngineRef::DestroyGPU ( TTF_TextEngine *  engine)
inlinestatic

All text created by this engine should be destroyed before calling this function.

Parameters
enginea TextEngineRef object created with TextEngine.CreateGPU().
Thread safety:
This function should be called on the thread that created the engine.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextEngine.CreateGPU

◆ DestroyRenderer()

static void SDL::TextEngineRef::DestroyRenderer ( TTF_TextEngine *  engine)
inlinestatic

All text created by this engine should be destroyed before calling this function.

Parameters
enginea TextEngineRef object created with TextEngine.CreateRenderer().
Thread safety:
This function should be called on the thread that created the engine.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextEngine.CreateRenderer

◆ DestroySurface()

static void SDL::TextEngineRef::DestroySurface ( TTF_TextEngine *  engine)
inlinestatic

All text created by this engine should be destroyed before calling this function.

Parameters
enginea TextEngineRef object created with TextEngine.CreateSurface().
Thread safety:
This function should be called on the thread that created the engine.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextEngine.CreateSurface

◆ GetGPUWinding()

GPUTextEngineWinding SDL::TextEngineRef::GetGPUWinding ( ) const
inline
Returns
the winding order used by the GPU text engine or GPU_TEXTENGINE_WINDING_INVALID in case of error.
Thread safety:
This function should be called on the thread that created the engine.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextEngineRef.SetGPUWinding

◆ SetGPUWinding()

void SDL::TextEngineRef::SetGPUWinding ( GPUTextEngineWinding  winding)
inline
Parameters
windingthe new winding order option.
Thread safety:
This function should be called on the thread that created the engine.
Since
This function is available since SDL_ttf 3.0.0.
See also
TextEngineRef.GetGPUWinding

The documentation for this struct was generated from the following file: