sdlSetHint function hints

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 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.2.0.

\sa SDL_GetHint \sa SDL_ResetHint \sa SDL_SetHintWithPriority

extern SDL_DECLSPEC bool SDLCALL SDL_SetHint(const char *name, const char *value)

Implementation

bool sdlSetHint(String? name, String? value) {
  final sdlSetHintLookupFunction = _libSdl
      .lookupFunction<
        Uint8 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)
    ..free(valuePointer);
  return result;
}