sdlSetHintWithPriority function

bool sdlSetHintWithPriority(
  1. String? name,
  2. String? value,
  3. int priority
)

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 SDL_TRUE if the hint was set, SDL_FALSE otherwise.

\since This function is available since SDL 2.0.0.

\sa SDL_GetHint \sa SDL_SetHint

extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)

Implementation

bool sdlSetHintWithPriority(String? name, String? value, int priority) {
  final sdlSetHintWithPriorityLookupFunction = libSdl2.lookupFunction<
      Int32 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;
}