glfwSetWindowIcon function

void glfwSetWindowIcon(
  1. Pointer<GLFWwindow> window,
  2. int count,
  3. Pointer<GLFWimage> images
)

! @brief Sets the icon for the specified window.

This function sets the icon of the specified window. If passed an array of candidate images, those of or closest to the sizes desired by the system are selected. If no images are specified, the window reverts to its default icon.

The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as packed sequential rows, starting from the top-left corner.

The desired image sizes varies depending on platform and system settings. The selected images will be rescaled as needed. Good sizes include 16x16, 32x32 and 48x48.

@paramin window The window whose icon to set. @paramin count The number of images in the specified array, or zero to revert to the default window icon. @paramin images The images to create the icon from. This is ignored if count is zero.

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

@pointer_lifetime The specified image data is copied before this function returns.

@remark @macos The GLFW window has no icon, as it is not a document window, so this function does nothing. The dock icon will be the same as the application bundle's icon. For more information on bundles, see the Bundle Programming Guide in the Mac Developer Library.

@remark @wayland There is no existing protocol to change an icon, the window will thus inherit the one defined in the application's desktop file. This function always emits @ref GLFW_PLATFORM_ERROR.

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

@sa @ref window_icon

@since Added in version 3.2.

@ingroup window

GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images)

Implementation

void glfwSetWindowIcon(
    Pointer<GLFWwindow> window, int count, Pointer<GLFWimage> images) {
  final glfwSetWindowIconLookupFunction = libglfw.lookupFunction<
      Void Function(
          Pointer<GLFWwindow> window, Int32 count, Pointer<GLFWimage> images),
      void Function(Pointer<GLFWwindow> window, int count,
          Pointer<GLFWimage> images)>('glfwSetWindowIcon');
  return glfwSetWindowIconLookupFunction(window, count, images);
}