diff --git a/doc/changelog.dox b/doc/changelog.dox index 1a4c7cdea..5253a7987 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -115,6 +115,11 @@ See also: - @ref magnum-sceneconverter "magnum-sceneconverter" now lists also materials and textures in `--info` +@subsubsection changelog-latest-changes-platform Platform libraries + +- Added a @ref Platform::GlfwApplication::setWindowIcon() overload taking a + @ref Corrade::Containers::ArrayView in addition to @ref std::initializer_list + @subsubsection changelog-latest-changes-shaders Shaders library - In the original implementation of normal mapping in @ref Shaders::Phong, diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 1c4653422..338483471 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -248,7 +248,7 @@ void GlfwApplication::setWindowTitle(const std::string& title) { #if GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302 void GlfwApplication::setWindowIcon(const ImageView2D& image) { - setWindowIcon({image}); + setWindowIcon({&image, 1}); } namespace { @@ -261,7 +261,7 @@ template inline void packPixels(const Containers::StridedArrayView2D images) { +void GlfwApplication::setWindowIcon(const Containers::ArrayView images) { /* Calculate the total size needed to allocate first so we don't allocate a ton of tiny arrays */ std::size_t size = 0; @@ -302,6 +302,10 @@ void GlfwApplication::setWindowIcon(std::initializer_list images) { glfwSetWindowIcon(_window, glfwImages.size(), glfwImages); } + +void GlfwApplication::setWindowIcon(std::initializer_list images) { + setWindowIcon(Containers::arrayView(images)); +} #endif bool GlfwApplication::tryCreate(const Configuration& configuration) { diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 2f7c6ab18..4c786c6be 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -470,7 +470,7 @@ class GlfwApplication { #if GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302 || defined(DOXYGEN_GENERATING_OUTPUT) /** * @brief Set window icon - * @m_since{2020,06} + * @m_since_latest * * The @p images are expected to be with origin at bottom left (which * is the default for imported images) and in one of @@ -484,6 +484,12 @@ class GlfwApplication { * @see @ref platform-windows-icon "Excecutable icon on Windows", * @ref Trade::IcoImporter "IcoImporter" */ + void setWindowIcon(Containers::ArrayView images); + + /** + * @overload + * @m_since{2020,06} + */ void setWindowIcon(std::initializer_list images); /**