sdlSetHintWithPriority function
Set a hint with a specific priority.
The priority controls the behavior when setting a hint that already has a value. Hints will replace existing hints of their priority and lower. Environment variables are considered to have override priority.
\param name the hint to set. \param value the value of the hint variable. \param priority the SDL_HintPriority level for the hint. \returns true on success or false on failure; call SDL_GetError() for more information.
\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_ResetHint \sa SDL_SetHint
extern SDL_DECLSPEC bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
Implementation
bool sdlSetHintWithPriority(String? name, String? value, int priority) {
final sdlSetHintWithPriorityLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Pointer<Utf8> name, Pointer<Utf8> value, Int32 priority),
int Function(Pointer<Utf8> name, Pointer<Utf8> value,
int priority)>('SDL_SetHintWithPriority');
final namePointer = name != null ? name.toNativeUtf8() : nullptr;
final valuePointer = value != null ? value.toNativeUtf8() : nullptr;
final result = sdlSetHintWithPriorityLookupFunction(
namePointer, valuePointer, priority) ==
1;
calloc.free(namePointer);
calloc.free(valuePointer);
return result;
}