ttfStringToTag function ttf
Convert from a 4 character string to a 32-bit tag.
\param string the 4 character string to convert. \returns the 32-bit representation of the string.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL_ttf 3.0.0.
\sa TTF_TagToString
extern SDL_DECLSPEC Uint32 SDLCALL TTF_StringToTag(const char *string)
Implementation
int ttfStringToTag(String? string) {
final ttfStringToTagLookupFunction = _libTtf
.lookupFunction<
Uint32 Function(Pointer<Utf8> string),
int Function(Pointer<Utf8> string)
>('TTF_StringToTag');
final stringPointer = string != null ? string.toNativeUtf8() : nullptr;
final result = ttfStringToTagLookupFunction(stringPointer);
calloc.free(stringPointer);
return result;
}