diff --git a/CMakeLists.txt b/CMakeLists.txt index c898fe09a..ba081b807 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) project(Magnum) 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. diff --git a/src/Audio/AbstractImporter.cpp b/src/Audio/AbstractImporter.cpp index 52fd83bb6..e5591e202 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/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index 394debc62..ef607fa54 100644 --- a/src/Platform/NaClApplication.h +++ b/src/Platform/NaClApplication.h @@ -349,6 +349,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; } diff --git a/src/Platform/Sdl2Application.cpp b/src/Platform/Sdl2Application.cpp index c6a18699b..a28f6a4e9 100644 --- a/src/Platform/Sdl2Application.cpp +++ b/src/Platform/Sdl2Application.cpp @@ -257,7 +257,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 0f6065240..616f0a4a4 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -397,19 +397,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; } @@ -455,7 +468,9 @@ class Sdl2Application::Configuration { } private: + #ifndef CORRADE_TARGET_EMSCRIPTEN std::string _title; + #endif Vector2i _size; Flags _flags; Int _sampleCount; diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index 863659b38..24313b1c1 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 229dd0e17..143c64738 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 b567c6176..2a733ca71 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp @@ -57,7 +57,7 @@ namespace { 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 7fdca4533..f34419edb 100644 --- a/src/Plugins/TgaImporter/TgaImporter.cpp +++ b/src/Plugins/TgaImporter/TgaImporter.cpp @@ -58,7 +58,7 @@ namespace { 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 181c77a29..b833ab9ab 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/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: diff --git a/src/Text/AbstractFont.cpp b/src/Text/AbstractFont.cpp index d52b7c773..24e0480f3 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 2299deb45..dea7e0cdb 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 b29e7db70..e9598d1e7 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 0804a8bbc..001f3d159 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(); } diff --git a/toolchains b/toolchains index ca539cf41..749095394 160000 --- a/toolchains +++ b/toolchains @@ -1 +1 @@ -Subproject commit ca539cf413142e70a6084b090ae5cfee77fd810a +Subproject commit 7490953943d6f23e7971b1b5076426dceb3c62eb