ttfDrawRendererText function

bool ttfDrawRendererText(
  1. Pointer<TtfText> text,
  2. double x,
  3. double y
)

Draw text to an SDL renderer.

text must have been created using a TTF_TextEngine from TTF_CreateRendererTextEngine(), and will draw using the renderer passed to that function.

\param text the text to draw. \param x the x coordinate in pixels, positive from the left edge towards the right. \param y the y coordinate in pixels, positive from the top edge towards the bottom. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should be called on the thread that created the text.

\since This function is available since SDL_ttf 3.0.0.

\sa TTF_CreateRendererTextEngine \sa TTF_CreateText

extern SDL_DECLSPEC bool SDLCALL TTF_DrawRendererText(TTF_Text *text, float x, float y)

Implementation

bool ttfDrawRendererText(Pointer<TtfText> text, double x, double y) {
  final ttfDrawRendererTextLookupFunction = libSdl3Ttf.lookupFunction<
      Uint8 Function(Pointer<TtfText> text, Float x, Float y),
      int Function(
          Pointer<TtfText> text, double x, double y)>('TTF_DrawRendererText');
  return ttfDrawRendererTextLookupFunction(text, x, y) == 1;
}