glfwSetWindowTitle function

void glfwSetWindowTitle(
  1. Pointer<GLFWwindow> window,
  2. String title
)

! @brief Sets the title of the specified window.

This function sets the window title, encoded as UTF-8, of the specified window.

@paramin window The window whose title to change. @paramin title The UTF-8 encoded window title.

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

@remark @macos The window title will not be updated until the next time you process events.

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

@sa @ref window_title

@since Added in version 1.0. @glfw3 Added window handle parameter.

@ingroup window

GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title)

Implementation

void glfwSetWindowTitle(Pointer<GLFWwindow> window, String title) {
  final glfwSetWindowTitleLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWwindow> window, Pointer<Utf8> title),
      void Function(Pointer<GLFWwindow> window,
          Pointer<Utf8> title)>('glfwSetWindowTitle');
  final titlePointer = title.toNativeUtf8();
  final result = glfwSetWindowTitleLookupFunction(window, titlePointer);
  calloc.free(titlePointer);
  return result;
}