Add glfwSetWindowIcon

Adds support for setting window icons programmatically on platforms
where this makes sense.

Fixes #453.
Closes #467.
This commit is contained in:
Camilla Berglund
2016-03-07 14:55:30 +01:00
parent 793eef1d0a
commit b823f7151e
14 changed files with 299 additions and 55 deletions

View File

@@ -32,6 +32,11 @@ GLFW now supports window maximization with @ref glfwMaximizeWindow and the
[GLFW_MAXIMIZED](@ref window_attribs_wnd) window hint and attribute.
@subsection news_32_icon Window icon support
GLFW now supports setting the icon of windows with @ref glfwSetWindowIcon.
@subsection news_32_focus Window input focus control
GLFW now supports giving windows input focus with @ref glfwFocusWindow.

View File

@@ -617,6 +617,26 @@ glfwSetWindowTitle(window, u8"This is always a UTF-8 string");
@endcode
@subsection window_icon Window icon
Decorated windows have icons on some platforms. You can set this icon by
specifying a list of candidate images with @ref glfwSetWindowIcon.
@code
GLFWimage images[2];
images[0] = load_icon("my_icon.png");
images[1] = load_icon("my_icon_small.png");
glfwSetWindowIcon(window, 2, images);
@endcode
To revert to the default window icon, pass in an empty image array.
@code
glfwSetWindowIcon(window, 0, NULL);
@endcode
@subsection window_monitor Window monitor
Full screen windows are associated with a specific monitor. You can get the