From 2157123de0d01824532223ae7a34f1970b6d2d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 16 Dec 2013 13:17:36 +0100 Subject: [PATCH 1/7] Updated toolchains submodule. --- toolchains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains b/toolchains index ca539cf41..749095394 160000 --- a/toolchains +++ b/toolchains @@ -1 +1 @@ -Subproject commit ca539cf413142e70a6084b090ae5cfee77fd810a +Subproject commit 7490953943d6f23e7971b1b5076426dceb3c62eb From f796b5a781a03e24c5cc1e614f99bd2f85795d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Dec 2013 19:14:34 +0100 Subject: [PATCH 2/7] Ignore CORRADE_DEPRECATED() macro in Doxygen. --- Doxyfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doxyfile b/Doxyfile index ee684d052..9ca729e08 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1611,7 +1611,7 @@ ENABLE_PREPROCESSING = YES # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. -MACRO_EXPANSION = NO +MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the @@ -1645,7 +1645,8 @@ INCLUDE_FILE_PATTERNS = # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = DOXYGEN_GENERATING_OUTPUT MAGNUM_BUILD_DEPRECATED +PREDEFINED = DOXYGEN_GENERATING_OUTPUT \ + MAGNUM_BUILD_DEPRECATED CORRADE_DEPRECATED(message)= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. From 48ee52b14f20a51b3b8370c00efa922ff5b6ce07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Dec 2013 19:15:18 +0100 Subject: [PATCH 3/7] Remove misleading comment. We need 2.8.8 for much more things. --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39eb2b647..bc0db64a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,6 @@ # DEALINGS IN THE SOFTWARE. # -# CMake 2.8.8 required for OBJECT library target cmake_minimum_required(VERSION 2.8.8) project(Magnum) From 5b56235084b8e1a643129487282c81e4611dec34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Dec 2013 20:59:19 +0100 Subject: [PATCH 4/7] Adapted to Corrade changes. --- src/Audio/AbstractImporter.cpp | 2 +- src/Audio/AbstractImporter.h | 2 +- src/Plugins/MagnumFont/MagnumFont.cpp | 2 +- src/Plugins/MagnumFont/MagnumFont.h | 2 +- src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp | 2 +- src/Plugins/MagnumFontConverter/MagnumFontConverter.h | 2 +- src/Plugins/TgaImageConverter/TgaImageConverter.cpp | 2 +- src/Plugins/TgaImageConverter/TgaImageConverter.h | 2 +- src/Plugins/TgaImporter/TgaImporter.cpp | 2 +- src/Plugins/TgaImporter/TgaImporter.h | 2 +- src/Plugins/WavAudioImporter/WavImporter.cpp | 2 +- src/Plugins/WavAudioImporter/WavImporter.h | 2 +- src/Text/AbstractFont.cpp | 2 +- src/Text/AbstractFont.h | 2 +- src/Text/AbstractFontConverter.cpp | 2 +- src/Text/AbstractFontConverter.h | 2 +- src/Trade/AbstractImageConverter.cpp | 2 +- src/Trade/AbstractImageConverter.h | 2 +- src/Trade/AbstractImporter.cpp | 2 +- src/Trade/AbstractImporter.h | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Audio/AbstractImporter.cpp b/src/Audio/AbstractImporter.cpp index 5272673f6..8ea19b564 100644 --- a/src/Audio/AbstractImporter.cpp +++ b/src/Audio/AbstractImporter.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Audio { AbstractImporter::AbstractImporter() = default; -AbstractImporter::AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {} +AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {} bool AbstractImporter::openData(Containers::ArrayReference data) { CORRADE_ASSERT(features() & Feature::OpenData, diff --git a/src/Audio/AbstractImporter.h b/src/Audio/AbstractImporter.h index ca0c3ff1b..f4ba8b15b 100644 --- a/src/Audio/AbstractImporter.h +++ b/src/Audio/AbstractImporter.h @@ -83,7 +83,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractPlugin explicit AbstractImporter(); /** @brief Plugin manager constructor */ - explicit AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin); + explicit AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin); /** @brief Features supported by this importer */ Features features() const { return doFeatures(); } diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index 46a3b1035..89a18202c 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -64,7 +64,7 @@ namespace { MagnumFont::MagnumFont(): _opened(nullptr) {} -MagnumFont::MagnumFont(PluginManager::AbstractManager* const manager, std::string plugin): AbstractFont(manager, std::move(plugin)), _opened(nullptr) {} +MagnumFont::MagnumFont(PluginManager::AbstractManager& manager, std::string plugin): AbstractFont(manager, std::move(plugin)), _opened(nullptr) {} MagnumFont::~MagnumFont() { close(); } diff --git a/src/Plugins/MagnumFont/MagnumFont.h b/src/Plugins/MagnumFont/MagnumFont.h index a9e69b1c3..a7e3ec65e 100644 --- a/src/Plugins/MagnumFont/MagnumFont.h +++ b/src/Plugins/MagnumFont/MagnumFont.h @@ -105,7 +105,7 @@ class MagnumFont: public AbstractFont { explicit MagnumFont(); /** @brief Plugin manager constructor */ - explicit MagnumFont(PluginManager::AbstractManager* manager, std::string plugin); + explicit MagnumFont(PluginManager::AbstractManager& manager, std::string plugin); ~MagnumFont(); diff --git a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp index bd6d0e732..64ca48c35 100644 --- a/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -38,7 +38,7 @@ namespace Magnum { namespace Text { MagnumFontConverter::MagnumFontConverter() = default; -MagnumFontConverter::MagnumFontConverter(PluginManager::AbstractManager* manager, std::string plugin): AbstractFontConverter(manager, std::move(plugin)) {} +MagnumFontConverter::MagnumFontConverter(PluginManager::AbstractManager& manager, std::string plugin): AbstractFontConverter(manager, std::move(plugin)) {} auto MagnumFontConverter::doFeatures() const -> Features { return Feature::ExportFont|Feature::ConvertData|Feature::MultiFile; diff --git a/src/Plugins/MagnumFontConverter/MagnumFontConverter.h b/src/Plugins/MagnumFontConverter/MagnumFontConverter.h index 64a074b17..a1a830861 100644 --- a/src/Plugins/MagnumFontConverter/MagnumFontConverter.h +++ b/src/Plugins/MagnumFontConverter/MagnumFontConverter.h @@ -55,7 +55,7 @@ class MagnumFontConverter: public Text::AbstractFontConverter { explicit MagnumFontConverter(); /** @brief Plugin manager constructor */ - explicit MagnumFontConverter(PluginManager::AbstractManager* manager, std::string plugin); + explicit MagnumFontConverter(PluginManager::AbstractManager& manager, std::string plugin); private: Features doFeatures() const override; diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp index 0e2a8e15e..7f2b2d663 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp @@ -45,7 +45,7 @@ namespace Magnum { namespace Trade { TgaImageConverter::TgaImageConverter() = default; -TgaImageConverter::TgaImageConverter(PluginManager::AbstractManager* manager, std::string plugin): AbstractImageConverter(manager, std::move(plugin)) {} +TgaImageConverter::TgaImageConverter(PluginManager::AbstractManager& manager, std::string plugin): AbstractImageConverter(manager, std::move(plugin)) {} auto TgaImageConverter::doFeatures() const -> Features { return Feature::ConvertData; } diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.h b/src/Plugins/TgaImageConverter/TgaImageConverter.h index 300bb2912..da7a73292 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.h +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.h @@ -65,7 +65,7 @@ class MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractIm explicit TgaImageConverter(); /** @brief Plugin manager constructor */ - explicit TgaImageConverter(PluginManager::AbstractManager* manager, std::string plugin); + explicit TgaImageConverter(PluginManager::AbstractManager& manager, std::string plugin); private: Features MAGNUM_TRADE_TGAIMAGECONVERTER_LOCAL doFeatures() const override; diff --git a/src/Plugins/TgaImporter/TgaImporter.cpp b/src/Plugins/TgaImporter/TgaImporter.cpp index b4c55ef76..1e8d7d769 100644 --- a/src/Plugins/TgaImporter/TgaImporter.cpp +++ b/src/Plugins/TgaImporter/TgaImporter.cpp @@ -46,7 +46,7 @@ namespace Magnum { namespace Trade { TgaImporter::TgaImporter(): in(nullptr) {} -TgaImporter::TgaImporter(PluginManager::AbstractManager* manager, std::string plugin): AbstractImporter(manager, std::move(plugin)), in(nullptr) {} +TgaImporter::TgaImporter(PluginManager::AbstractManager& manager, std::string plugin): AbstractImporter(manager, std::move(plugin)), in(nullptr) {} TgaImporter::~TgaImporter() { close(); } diff --git a/src/Plugins/TgaImporter/TgaImporter.h b/src/Plugins/TgaImporter/TgaImporter.h index 7dc87c3d8..ff0bc78a1 100644 --- a/src/Plugins/TgaImporter/TgaImporter.h +++ b/src/Plugins/TgaImporter/TgaImporter.h @@ -74,7 +74,7 @@ class MAGNUM_TRADE_TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter { explicit TgaImporter(); /** @brief Plugin manager constructor */ - explicit TgaImporter(PluginManager::AbstractManager* manager, std::string plugin); + explicit TgaImporter(PluginManager::AbstractManager& manager, std::string plugin); ~TgaImporter(); diff --git a/src/Plugins/WavAudioImporter/WavImporter.cpp b/src/Plugins/WavAudioImporter/WavImporter.cpp index db93e0885..882112c36 100644 --- a/src/Plugins/WavAudioImporter/WavImporter.cpp +++ b/src/Plugins/WavAudioImporter/WavImporter.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Audio { WavImporter::WavImporter() = default; -WavImporter::WavImporter(PluginManager::AbstractManager* manager, std::string plugin): AbstractImporter(manager, std::move(plugin)) {} +WavImporter::WavImporter(PluginManager::AbstractManager& manager, std::string plugin): AbstractImporter(manager, std::move(plugin)) {} WavImporter::~WavImporter() { close(); } diff --git a/src/Plugins/WavAudioImporter/WavImporter.h b/src/Plugins/WavAudioImporter/WavImporter.h index 42365daf5..58c8d2c84 100644 --- a/src/Plugins/WavAudioImporter/WavImporter.h +++ b/src/Plugins/WavAudioImporter/WavImporter.h @@ -55,7 +55,7 @@ class WavImporter: public AbstractImporter { explicit WavImporter(); /** @brief Plugin manager constructor */ - explicit WavImporter(PluginManager::AbstractManager* manager, std::string plugin); + explicit WavImporter(PluginManager::AbstractManager& manager, std::string plugin); ~WavImporter(); diff --git a/src/Text/AbstractFont.cpp b/src/Text/AbstractFont.cpp index 86c17749c..ccb1c3ef5 100644 --- a/src/Text/AbstractFont.cpp +++ b/src/Text/AbstractFont.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Text { AbstractFont::AbstractFont(): _size(0.0f) {} -AbstractFont::AbstractFont(PluginManager::AbstractManager* manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)), _size(0.0f), _lineHeight(0.0f) {} +AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)), _size(0.0f), _lineHeight(0.0f) {} bool AbstractFont::openData(const std::vector>>& data, const Float size) { CORRADE_ASSERT(features() & Feature::OpenData, diff --git a/src/Text/AbstractFont.h b/src/Text/AbstractFont.h index 21f620c8c..6c6851e04 100644 --- a/src/Text/AbstractFont.h +++ b/src/Text/AbstractFont.h @@ -105,7 +105,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { explicit AbstractFont(); /** @brief Plugin manager constructor */ - explicit AbstractFont(PluginManager::AbstractManager* manager, std::string plugin); + explicit AbstractFont(PluginManager::AbstractManager& manager, std::string plugin); /** @brief Features supported by this font */ Features features() const { return doFeatures(); } diff --git a/src/Text/AbstractFontConverter.cpp b/src/Text/AbstractFontConverter.cpp index e375e5fd7..0c1711598 100644 --- a/src/Text/AbstractFontConverter.cpp +++ b/src/Text/AbstractFontConverter.cpp @@ -36,7 +36,7 @@ namespace Magnum { namespace Text { AbstractFontConverter::AbstractFontConverter() = default; -AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager* manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {} +AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {} std::vector>> AbstractFontConverter::exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const { CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), diff --git a/src/Text/AbstractFontConverter.h b/src/Text/AbstractFontConverter.h index fad9254da..b000f8572 100644 --- a/src/Text/AbstractFontConverter.h +++ b/src/Text/AbstractFontConverter.h @@ -122,7 +122,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl explicit AbstractFontConverter(); /** @brief Plugin manager constructor */ - explicit AbstractFontConverter(PluginManager::AbstractManager* manager, std::string plugin); + explicit AbstractFontConverter(PluginManager::AbstractManager& manager, std::string plugin); /** @brief Features supported by this converter */ Features features() const { return doFeatures(); } diff --git a/src/Trade/AbstractImageConverter.cpp b/src/Trade/AbstractImageConverter.cpp index 705bef996..4e22d6f60 100644 --- a/src/Trade/AbstractImageConverter.cpp +++ b/src/Trade/AbstractImageConverter.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Trade { AbstractImageConverter::AbstractImageConverter() = default; -AbstractImageConverter::AbstractImageConverter(PluginManager::AbstractManager* manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {} +AbstractImageConverter::AbstractImageConverter(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {} Image2D* AbstractImageConverter::exportToImage(const ImageReference2D& image) const { CORRADE_ASSERT(features() & Feature::ConvertImage, diff --git a/src/Trade/AbstractImageConverter.h b/src/Trade/AbstractImageConverter.h index 2bb7d8e22..d3f46e1d9 100644 --- a/src/Trade/AbstractImageConverter.h +++ b/src/Trade/AbstractImageConverter.h @@ -83,7 +83,7 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractPlugin explicit AbstractImageConverter(); /** @brief Plugin manager constructor */ - explicit AbstractImageConverter(PluginManager::AbstractManager* manager, std::string plugin); + explicit AbstractImageConverter(PluginManager::AbstractManager& manager, std::string plugin); /** @brief Features supported by this converter */ Features features() const { return doFeatures(); } diff --git a/src/Trade/AbstractImporter.cpp b/src/Trade/AbstractImporter.cpp index 53dedd74b..d6bc760c3 100644 --- a/src/Trade/AbstractImporter.cpp +++ b/src/Trade/AbstractImporter.cpp @@ -43,7 +43,7 @@ namespace Magnum { namespace Trade { AbstractImporter::AbstractImporter() = default; -AbstractImporter::AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {} +AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {} bool AbstractImporter::openData(Containers::ArrayReference data) { CORRADE_ASSERT(features() & Feature::OpenData, diff --git a/src/Trade/AbstractImporter.h b/src/Trade/AbstractImporter.h index baf72f080..ef427065c 100644 --- a/src/Trade/AbstractImporter.h +++ b/src/Trade/AbstractImporter.h @@ -95,7 +95,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin { explicit AbstractImporter(); /** @brief Plugin manager constructor */ - explicit AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin); + explicit AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin); /** @brief Features supported by this importer */ Features features() const { return doFeatures(); } From 27a80cb76e737c3ddcc127f9d5350be1388ea38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Dec 2013 21:12:17 +0100 Subject: [PATCH 5/7] Shaders: doc++ --- src/Shaders/Flat.h | 3 ++- src/Shaders/Vector.h | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Shaders/Flat.h b/src/Shaders/Flat.h index 955a62f2e..00740ddae 100644 --- a/src/Shaders/Flat.h +++ b/src/Shaders/Flat.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Class Magnum::Shaders::Flat + * @brief Class @ref Magnum::Shaders::Flat, typedef @ref Magnum::Shaders::Flat2D, @ref Magnum::Shaders::Flat3D */ #include "Math/Matrix3.h" @@ -62,6 +62,7 @@ Shaders::Flat2D shader(Shaders::Flat2D::Flag::Textured); myTexture.bind(Shaders::Flat2D::TextureLayer); @endcode +For coloring the texture based on intensity you can use the @ref Vector shader. @see @ref Flat2D, @ref Flat3D */ template class MAGNUM_SHADERS_EXPORT Flat: public AbstractShaderProgram { diff --git a/src/Shaders/Vector.h b/src/Shaders/Vector.h index 45c800bab..4f0ab789d 100644 --- a/src/Shaders/Vector.h +++ b/src/Shaders/Vector.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Class Magnum::Shaders::Vector, typedef Magnum::Shaders::Vector2D, Magnum::Shaders::Vector3D + * @brief Class @ref Magnum::Shaders::Vector, typedef @ref Magnum::Shaders::Vector2D, @ref Magnum::Shaders::Vector3D */ #include "Math/Matrix3.h" @@ -41,9 +41,10 @@ namespace Magnum { namespace Shaders { /** @brief %Vector shader -Renders vector art in plain grayscale form. See also DistanceFieldVector -for more advanced effects. -@see Vector2D, Vector3D +Renders vector art in plain grayscale form. See also @ref DistanceFieldVector +for more advanced effects. For rendering unchanged texture you can use the +@ref Flat shader. +@see @ref Vector2D, @ref Vector3D */ template class MAGNUM_SHADERS_EXPORT Vector: public AbstractVector { public: From fc1a486f0086f3389e9a5f0fa084b3ea77199350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 18 Dec 2013 00:52:12 +0100 Subject: [PATCH 6/7] Platform: ignore Sdl2Application title in Emscripten. --- src/Platform/Sdl2Application.cpp | 7 ++++++- src/Platform/Sdl2Application.h | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/Platform/Sdl2Application.cpp b/src/Platform/Sdl2Application.cpp index 417daa0e4..91b4d3d3b 100644 --- a/src/Platform/Sdl2Application.cpp +++ b/src/Platform/Sdl2Application.cpp @@ -251,7 +251,12 @@ void Sdl2Application::mousePressEvent(MouseEvent&) {} void Sdl2Application::mouseReleaseEvent(MouseEvent&) {} void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {} -Sdl2Application::Configuration::Configuration(): _title("Magnum SDL2 Application"), _size(800, 600), _flags(Flag::Resizable), _sampleCount(0) {} +Sdl2Application::Configuration::Configuration(): + #ifndef CORRADE_TARGET_EMSCRIPTEN + _title("Magnum SDL2 Application"), + #endif + _size(800, 600), _flags(Flag::Resizable), _sampleCount(0) {} + Sdl2Application::Configuration::~Configuration() = default; Sdl2Application::InputEvent::Modifiers Sdl2Application::MouseEvent::modifiers() { diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index 2ae5230b6..50e9339bf 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -393,19 +393,32 @@ class Sdl2Application::Configuration { /*implicit*/ Configuration(); ~Configuration(); - /** @brief Window title */ + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** + * @brief Window title + * + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN. + */ std::string title() const { return _title; } + #endif /** * @brief Set window title * @return Reference to self (for method chaining) * * Default is `"Magnum SDL2 Application"`. + * @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" this function + * does nothing and is included only for compatibility. You need + * to set the title separately in application's HTML markup. */ + #ifndef CORRADE_TARGET_EMSCRIPTEN Configuration& setTitle(std::string title) { _title = std::move(title); return *this; } + #else + template Configuration& setTitle(const T&) { return *this; } + #endif /** @brief Window size */ Vector2i size() const { return _size; } @@ -451,7 +464,9 @@ class Sdl2Application::Configuration { } private: + #ifndef CORRADE_TARGET_EMSCRIPTEN std::string _title; + #endif Vector2i _size; Flags _flags; Int _sampleCount; From d4162a4160e68be9015874d1ad4ce647978f1738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 18 Dec 2013 00:52:47 +0100 Subject: [PATCH 7/7] Platform: add dummy title setting function to NaClApplication. So the user doesn't need to wrap it in #ifdefs when porting to NaCl. --- src/Platform/NaClApplication.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index d09e62605..9c1642809 100644 --- a/src/Platform/NaClApplication.h +++ b/src/Platform/NaClApplication.h @@ -345,6 +345,16 @@ class NaClApplication::Configuration { public: constexpr /*implicit*/ Configuration(): _size(640, 480), _sampleCount(0) {} + /** + * @brief Set window title + * @return Reference to self (for method chaining) + * + * @note This function does nothing and is included only for + * compatibility with other toolkits. You need to set the title + * separately in application's HTML markup. + */ + template Configuration& setTitle(const T&) { return *this; } + /** @brief Window size */ Vector2i size() const { return _size; }