glfwWindowHintString function

void glfwWindowHintString(
  1. int hint,
  2. String value
)

! @brief Sets the specified window hint to the desired value.

This function sets hints for the next call to @ref glfwCreateWindow. The hints, once set, retain their values until changed by a call to this function or @ref glfwDefaultWindowHints, or until the library is terminated.

Only string type hints can be set with this function. Integer value hints are set with @ref glfwWindowHint.

This function does not check whether the specified hint values are valid. If you set hints to invalid values this will instead be reported by the next call to @ref glfwCreateWindow.

Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. Setting these hints requires no platform specific headers or functions.

@paramin hint The window hint(@ref window_hints) to set. @paramin value The new value of the window hint.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_INVALID_ENUM.

@pointer_lifetime The specified string is copied before this function returns.

@thread_safety This function must only be called from the main thread.

@sa @ref window_hints @sa @ref glfwWindowHint @sa @ref glfwDefaultWindowHints

@since Added in version 3.3.

@ingroup window

GLFWAPI void glfwWindowHintString(int hint, const char* value)

Implementation

void glfwWindowHintString(int hint, String value) {
  final glfwWindowHintStringLookupFunction = libglfw.lookupFunction<
      Void Function(Int32 hint, Pointer<Utf8> value),
      void Function(int hint, Pointer<Utf8> value)>('glfwWindowHintString');
  final valuePointer = value.toNativeUtf8();
  final result = glfwWindowHintStringLookupFunction(hint, valuePointer);
  calloc.free(valuePointer);
  return result;
}