From beaeb0d4af53b62a86c7880b7180597c7f164145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 6 Jun 2017 18:17:58 +0200 Subject: [PATCH] Add missing pixel format documentation Fixes #1027. --- docs/input.dox | 4 ++-- docs/window.dox | 4 ++++ include/GLFW/glfw3.h | 11 +++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/input.dox b/docs/input.dox index b5b853aa..bc1d1a7b 100644 --- a/docs/input.dox +++ b/docs/input.dox @@ -346,8 +346,8 @@ If cursor creation fails, `NULL` will be returned, so it is necessary to check the return value. The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits -per channel. The pixels are arranged canonically as sequential rows, starting -from the top-left corner. +per channel with the red channel first. The pixels are arranged canonically as +sequential rows, starting from the top-left corner. @subsubsection cursor_standard Standard cursor creation diff --git a/docs/window.dox b/docs/window.dox index c8d4a18e..8bd87e13 100644 --- a/docs/window.dox +++ b/docs/window.dox @@ -785,6 +785,10 @@ images[1] = load_icon("my_icon_small.png"); glfwSetWindowIcon(window, 2, images); @endcode +The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits +per channel with the red channel first. The pixels are arranged canonically as +sequential rows, starting from the top-left corner. + To revert to the default window icon, pass in an empty image array. @code diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index f3c8e1ff..3b2d5b85 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -1458,6 +1458,9 @@ typedef struct GLFWgammaramp } GLFWgammaramp; /*! @brief Image data. + * + * This describes a single 2D image. See the documentation for each related + * function what the expected pixel format is. * * @sa @ref cursor_custom * @sa @ref window_icon @@ -2323,6 +2326,10 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); * 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. @@ -3726,8 +3733,8 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); * Any remaining cursors are destroyed by @ref glfwTerminate. * * The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight - * bits per channel. They are arranged canonically as packed sequential rows, - * starting from the top-left corner. + * bits per channel with the red channel first. They are arranged canonically + * as packed sequential rows, starting from the top-left corner. * * The cursor hotspot is specified in pixels, relative to the upper-left corner * of the cursor image. Like all other coordinate systems in GLFW, the X-axis