[go: up one dir, main page]

glfwSetWindowIcon

Function glfwSetWindowIcon 

Source
pub unsafe extern "C" fn glfwSetWindowIcon(
    window: *mut GLFWwindow,
    count: i32,
    images: *const GLFWimage,
)
Expand description

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

@param[in] window The window whose icon to set. @param[in] count The number of images in the specified array, or zero to revert to the default window icon. @param[in] 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, @ref GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).

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

@remark @macos Regular windows do not have icons on macOS. This function will emit @ref GLFW_FEATURE_UNAVAILABLE. 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 will emit @ref GLFW_FEATURE_UNAVAILABLE.

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

@sa @ref window_icon

@since Added in version 3.2.

@ingroup window