sdlGetHintBoolean function
Get the boolean value of a hint variable.
\param name the name of the hint to get the boolean value from. \param default_value the value to return if the hint does not exist. \returns the boolean value of a hint or the provided default value if the hint does not exist.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.1.3.
\sa SDL_GetHint \sa SDL_SetHint
extern SDL_DECLSPEC bool SDLCALL SDL_GetHintBoolean(const char *name, bool default_value)
Implementation
bool sdlGetHintBoolean(String? name, bool defaultValue) {
final sdlGetHintBooleanLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Pointer<Utf8> name, Uint8 defaultValue),
int Function(Pointer<Utf8> name, int defaultValue)>('SDL_GetHintBoolean');
final namePointer = name != null ? name.toNativeUtf8() : nullptr;
final result =
sdlGetHintBooleanLookupFunction(namePointer, defaultValue ? 1 : 0) == 1;
calloc.free(namePointer);
return result;
}