Browse Source

Platform: added view-taking Platform::GlfwApplication::setWindowIcon().

For some reason there's just an initializer-list overload, which is
rather useless.
pull/470/head
Vladimír Vondruš 6 years ago
parent
commit
18a05309e9
  1. 5
      doc/changelog.dox
  2. 8
      src/Magnum/Platform/GlfwApplication.cpp
  3. 8
      src/Magnum/Platform/GlfwApplication.h

5
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,

8
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<class T> inline void packPixels(const Containers::StridedArrayView2D<co
}
void GlfwApplication::setWindowIcon(std::initializer_list<ImageView2D> images) {
void GlfwApplication::setWindowIcon(const Containers::ArrayView<const ImageView2D> 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<ImageView2D> images) {
glfwSetWindowIcon(_window, glfwImages.size(), glfwImages);
}
void GlfwApplication::setWindowIcon(std::initializer_list<ImageView2D> images) {
setWindowIcon(Containers::arrayView(images));
}
#endif
bool GlfwApplication::tryCreate(const Configuration& configuration) {

8
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<const ImageView2D> images);
/**
* @overload
* @m_since{2020,06}
*/
void setWindowIcon(std::initializer_list<ImageView2D> images);
/**

Loading…
Cancel
Save