sdlSetHint function

bool sdlSetHint(
  1. String? name,
  2. String? value
)

Set a hint with normal priority.

Hints will not be set if there is an existing override hint or environment variable that takes precedence. You can use SDL_SetHintWithPriority() to set the hint with override priority instead.

\param name the hint to set \param value the value of the hint variable \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_SetHintWithPriority

extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *value)

Implementation

bool sdlSetHint(String? name, String? value) {
  final sdlSetHintLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<Utf8> name, Pointer<Utf8> value),
      int Function(Pointer<Utf8> name, Pointer<Utf8> value)>('SDL_SetHint');
  final namePointer = name != null ? name.toNativeUtf8() : nullptr;
  final valuePointer = value != null ? value.toNativeUtf8() : nullptr;
  final result = sdlSetHintLookupFunction(namePointer, valuePointer) == 1;
  calloc.free(namePointer);
  calloc.free(valuePointer);
  return result;
}