From 86d23ddcaae0d7d182c59b44fa114c632399ac3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 09:18:55 +0200 Subject: [PATCH 01/18] Updated toolchains submodule. --- toolchains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchains b/toolchains index 19d1e7ee8..7380270cc 160000 --- a/toolchains +++ b/toolchains @@ -1 +1 @@ -Subproject commit 19d1e7ee8bc61a6e1b4871c93e3aca4743e0ca9e +Subproject commit 7380270cc5d8e399cb06f463ac681adcbd591d54 From bbef61a4f7e015b5c7ccc3ef4a5722eef91ddd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 09:19:06 +0200 Subject: [PATCH 02/18] package: adapted Emscripten PKGBUILD to emscripten-git AUR package. --- package/archlinux/PKGBUILD-emscripten | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/archlinux/PKGBUILD-emscripten b/package/archlinux/PKGBUILD-emscripten index e25fa841f..acfeed663 100644 --- a/package/archlinux/PKGBUILD-emscripten +++ b/package/archlinux/PKGBUILD-emscripten @@ -7,7 +7,7 @@ arch=('any') url="http://mosra.cz/blog/magnum.php" license=('MIT') depends=('emscripten-corrade') -makedepends=('cmake' 'ninja') +makedepends=('cmake' 'ninja' 'emscripten-git') options=('!strip' '!buildflags' 'staticlibs') build() { @@ -25,7 +25,7 @@ build() { cmake .. \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/emscripten/system \ + -DCMAKE_INSTALL_PREFIX=/usr/lib/emscripten/system \ -DWITH_SDL2APPLICATION=ON \ -DWITH_MAGNUMFONT=ON \ -DWITH_OBJIMPORTER=ON \ From 16eb32740b28b80a915fc9a681991bcfd687a10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 09:19:40 +0200 Subject: [PATCH 03/18] Math: added Range::data(). The main side-effect of this is that the data layout is now really specified, making it useful for various glGet*(GL_*_RANGE) calls. --- src/Magnum/Math/Range.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 8f6c45b1a..2c4404326 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -103,6 +103,13 @@ template class Range { return !operator==(other); } + /** + * @brief Raw data + * @return One-dimensional array of `dimensions`*2 length. + */ + T* data() { return _min.data(); } + constexpr const T* data() const { return _min.data(); } /**< @overload */ + /** * @brief Minimal coordinates (inclusive) * From 7f4a986c38d2403bbf8dbbb7eb9c4683e4ea4e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 09:25:54 +0200 Subject: [PATCH 04/18] Added Context::detectedDriver(). A general way to detect drivers, which can be later used for applying driver-specific workarounds. Currently used for disabling ARB_explicit_uniform_location on AMD drivers. --- src/Magnum/CMakeLists.txt | 1 + src/Magnum/Context.h | 31 +++++++++++++ src/Magnum/Implementation/detectedDriver.cpp | 46 +++++++++++++++++++ .../Implementation/setupDriverWorkarounds.cpp | 3 +- 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 src/Magnum/Implementation/detectedDriver.cpp diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index c3b0cf490..dd7499091 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -62,6 +62,7 @@ set(Magnum_SRCS Implementation/ShaderProgramState.cpp Implementation/State.cpp Implementation/TextureState.cpp + Implementation/detectedDriver.cpp Implementation/maxTextureSize.cpp Implementation/setupDriverWorkarounds.cpp diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 93eee5bef..90aa81797 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -38,6 +38,7 @@ #include "Magnum/Magnum.h" #include "Magnum/OpenGL.h" #include "Magnum/visibility.h" +#include "MagnumExternal/Optional/optional.hpp" namespace Magnum { @@ -169,6 +170,25 @@ class MAGNUM_EXPORT Context { */ typedef Containers::EnumSet States; + /** + * @brief Detected driver + * + * @see @ref DetectedDriver, @ref detectedDriver() + */ + enum class DetectedDriver: UnsignedShort { + #ifndef MAGNUM_TARGET_GLES + /** Binary AMD desktop drivers on Windows and Linux */ + AMD = 1 << 0 + #endif + }; + + /** + * @brief Detected drivers + * + * @see @ref detectedDriver() + */ + typedef Containers::EnumSet DetectedDrivers; + /** * @brief Constructor * @@ -432,6 +452,15 @@ class MAGNUM_EXPORT Context { */ void resetState(States states = ~States{}); + /** + * @brief Detect driver + * + * Tries to detect driver using various OpenGL state queries. Once the + * detection is done, the result is cached, repeated queries don't + * result in repeated GL calls. + */ + DetectedDrivers detectedDriver(); + #ifndef DOXYGEN_GENERATING_OUTPUT Implementation::State& state() { return *_state; } #endif @@ -451,6 +480,8 @@ class MAGNUM_EXPORT Context { std::vector _supportedExtensions; Implementation::State* _state; + + std::optional _detectedDrivers; }; /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flag} */ diff --git a/src/Magnum/Implementation/detectedDriver.cpp b/src/Magnum/Implementation/detectedDriver.cpp new file mode 100644 index 000000000..d672bb71e --- /dev/null +++ b/src/Magnum/Implementation/detectedDriver.cpp @@ -0,0 +1,46 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include "Magnum/Context.h" +#include "Magnum/Math/Range.h" + +namespace Magnum { + +auto Context::detectedDriver() -> Context::DetectedDrivers { + if(_detectedDrivers) return *_detectedDrivers; + + _detectedDrivers = DetectedDrivers{}; + + /* AMD binary desktop drivers */ + #ifndef MAGNUM_TARGET_GLES + const std::string vendor = vendorString(); + if(vendor.find("ATI Technologies Inc.") != std::string::npos) + return *_detectedDrivers |= DetectedDriver::AMD; + #endif + + return *_detectedDrivers; +} + +} diff --git a/src/Magnum/Implementation/setupDriverWorkarounds.cpp b/src/Magnum/Implementation/setupDriverWorkarounds.cpp index a29332253..ca7c0bb70 100644 --- a/src/Magnum/Implementation/setupDriverWorkarounds.cpp +++ b/src/Magnum/Implementation/setupDriverWorkarounds.cpp @@ -35,8 +35,7 @@ void Context::setupDriverWorkarounds() { #ifndef MAGNUM_TARGET_GLES /* This extension causes crash in GLSL compiler on AMD linux drivers 13.251 */ - const std::string vendor = vendorString(); - if(vendor.find("ATI Technologies Inc.") != std::string::npos) + if(detectedDriver() & DetectedDriver::AMD) _setRequiredVersion(GL::ARB::explicit_uniform_location, None); #endif From fcea05e316c6cc9ae190c0703e2cc2236fb94280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:09:28 +0200 Subject: [PATCH 05/18] Detecting whether ANGLE is used as GLES2 implementation. --- src/Magnum/Context.h | 12 +++++++++++- src/Magnum/Implementation/detectedDriver.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 90aa81797..6399b6597 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -178,7 +178,17 @@ class MAGNUM_EXPORT Context { enum class DetectedDriver: UnsignedShort { #ifndef MAGNUM_TARGET_GLES /** Binary AMD desktop drivers on Windows and Linux */ - AMD = 1 << 0 + AMD = 1 << 0, + #endif + + #ifdef MAGNUM_TARGET_GLES2 + /** + * OpenGL ES 2.0 implementation by ANGLE (translated to D3D9), used + * by browsers on Windows for Native Client and WebGL. As the WebGL + * specification explicitly disallows exposing driver information + * to the application, this check cannot be done reliably. + */ + ProbablyAngle = 1 << 1 #endif }; diff --git a/src/Magnum/Implementation/detectedDriver.cpp b/src/Magnum/Implementation/detectedDriver.cpp index d672bb71e..60ada7803 100644 --- a/src/Magnum/Implementation/detectedDriver.cpp +++ b/src/Magnum/Implementation/detectedDriver.cpp @@ -40,6 +40,17 @@ auto Context::detectedDriver() -> Context::DetectedDrivers { return *_detectedDrivers |= DetectedDriver::AMD; #endif + /* OpenGL ES 2.0 implementation using ANGLE. Taken from + http://stackoverflow.com/a/20149090 */ + #ifdef MAGNUM_TARGET_GLES2 + { + Range1Di range; + glGetIntegerv(GL_ALIASED_LINE_WIDTH_RANGE, range.data()); + if(range.min() == 1 && range.max() == 1) + return *_detectedDrivers |= DetectedDriver::ProbablyAngle; + } + #endif + return *_detectedDrivers; } From 4a44d3b87517b52cc115b5a2066c5577a51df027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:10:08 +0200 Subject: [PATCH 06/18] Shaders: fix compilation of MeshVisualizer on WebGL and ANGLE. WebGL mandates that array subscription is done with constant expression, ANGLE too (but I think that has also something to do with D3D9 limitations). This is however allowed by OpenGL ES 2.0 specification, so enabling the workaround only for WebGL and ANGLE (i.e., this won't apply to Native Client using native GL drivers). --- src/Magnum/Shaders/MeshVisualizer.cpp | 6 ++++++ src/Magnum/Shaders/MeshVisualizer.vert | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Shaders/MeshVisualizer.cpp b/src/Magnum/Shaders/MeshVisualizer.cpp index c0d50e681..f0d3a900f 100644 --- a/src/Magnum/Shaders/MeshVisualizer.cpp +++ b/src/Magnum/Shaders/MeshVisualizer.cpp @@ -61,6 +61,12 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP vert.addSource(flags & Flag::Wireframe ? "#define WIREFRAME_RENDERING\n" : "") .addSource(flags & Flag::NoGeometryShader ? "#define NO_GEOMETRY_SHADER\n" : "") + #ifdef MAGNUM_TARGET_WEBGL + .addSource("#define SUBSCRIPTING_WORKAROUND\n") + #elif defined(MAGNUM_TARGET_GLES) + .addSource(Context::current()->detectedDriver() & Context::DetectedDriver::ProbablyAngle ? + "#define SUBSCRIPTING_WORKAROUND\n" : "") + #endif .addSource(rs.get("generic.glsl")) .addSource(rs.get("MeshVisualizer.vert")); frag.addSource(flags & Flag::Wireframe ? "#define WIREFRAME_RENDERING\n" : "") diff --git a/src/Magnum/Shaders/MeshVisualizer.vert b/src/Magnum/Shaders/MeshVisualizer.vert index 156553f49..b8adcb1ba 100644 --- a/src/Magnum/Shaders/MeshVisualizer.vert +++ b/src/Magnum/Shaders/MeshVisualizer.vert @@ -58,10 +58,17 @@ void main() { #if defined(WIREFRAME_RENDERING) && defined(NO_GEOMETRY_SHADER) barycentric = vec3(0.0); - #ifndef NEW_GLSL + + #ifdef SUBSCRIPTING_WORKAROUND + int i = int(mod(vertexIndex, 3.0)); + if(i == 0) barycentric.x = 1.0; + else if(i == 1) barycentric.y = 1.0; + else barycentric.z = 1.0; + #elif !defined(NEW_GLSL) barycentric[int(mod(vertexIndex, 3.0))] = 1.0; #else barycentric[gl_VertexID % 3] = 1.0; #endif + #endif } From 48bb59626b183ffbe6e44f409beb02f28197af5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:15:19 +0200 Subject: [PATCH 07/18] Oh Doxygen you so predictable. --- doc/cmake.dox | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/cmake.dox b/doc/cmake.dox index 73732b990..da9e2b171 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -156,7 +156,8 @@ variable along with `MAGNUM_PLUGINS_*_DEBUG_DIR` / `MAGNUM_PLUGINS_*_RELEASE_DIR variables to decide in preprocessing step. Features of found %Magnum library are exposed in these CMake variables, they -are also available as preprocessor variables if including @ref Magnum/Magnum.h: +are also available as preprocessor variables if including +@ref Magnum/Magnum.h "Magnum/Magnum.h": - `MAGNUM_BUILD_DEPRECATED` -- Defined if compiled with deprecated APIs included From a97d7bbdaed5d25e1a6d2937e4a8ea88bae90246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:32:01 +0200 Subject: [PATCH 08/18] Text: renamed configure.h.cmake to fontconverterConfigure.h.cmake. Reason is that the configure file is not for whole Text library, but only for the magnum-fontconverter utility. Rename it so it is more clear. --- src/Magnum/Text/CMakeLists.txt | 6 +++--- src/Magnum/Text/fontconverter.cpp | 2 +- .../{configure.h.cmake => fontconverterConfigure.h.cmake} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename src/Magnum/Text/{configure.h.cmake => fontconverterConfigure.h.cmake} (100%) diff --git a/src/Magnum/Text/CMakeLists.txt b/src/Magnum/Text/CMakeLists.txt index 50e59a4a8..5513a8d5d 100644 --- a/src/Magnum/Text/CMakeLists.txt +++ b/src/Magnum/Text/CMakeLists.txt @@ -60,10 +60,10 @@ install(TARGETS MagnumText install(FILES ${MagnumText_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Text) if(WITH_FONTCONVERTER) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/configure.h) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fontconverterConfigure.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/fontconverterConfigure.h) - include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(magnum-fontconverter fontconverter.cpp) diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 690c87784..6e69bf9cb 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -42,7 +42,7 @@ #error No windowless application available on this platform #endif -#include "configure.h" +#include "fontconverterConfigure.h" namespace Magnum { namespace Text { diff --git a/src/Magnum/Text/configure.h.cmake b/src/Magnum/Text/fontconverterConfigure.h.cmake similarity index 100% rename from src/Magnum/Text/configure.h.cmake rename to src/Magnum/Text/fontconverterConfigure.h.cmake From 41b892296b6002acdc0a905a9c94407e292faf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:42:03 +0200 Subject: [PATCH 09/18] Text: unified help message for plugin names for all utilities. --- src/Magnum/Text/fontconverter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 6e69bf9cb..946f6bd23 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -59,8 +59,8 @@ class FontConverter: public Platform::WindowlessApplication { FontConverter::FontConverter(const Arguments& arguments): Platform::WindowlessApplication(arguments, nullptr) { args.addArgument("input").setHelp("input", "input font") .addArgument("output").setHelp("output", "output filename prefix") - .addNamedArgument("font").setHelp("font", "plugin for opening the font") - .addNamedArgument("converter").setHelp("converter", "plugin for converting the font") + .addNamedArgument("font").setHelp("font", "font plugin") + .addNamedArgument("converter").setHelp("converter", "font converter plugin") .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelpKey("plugin-dir", "DIR").setHelp("plugin-dir", "base plugin dir") .addOption("characters", "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" From 66af4edd7f2a73d4eeb552aae1e18c9b92db8638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:42:47 +0200 Subject: [PATCH 10/18] Text: actually make use of plugin-dir parameter in fontconverter utility. What the hell. --- src/Magnum/Text/fontconverter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 946f6bd23..794e3918d 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -77,16 +77,16 @@ FontConverter::FontConverter(const Arguments& arguments): Platform::WindowlessAp int FontConverter::exec() { /* Font converter dependencies */ - PluginManager::Manager imageConverterManager(Utility::Directory::join(MAGNUM_PLUGINS_DIR, "imageconverters/")); + PluginManager::Manager imageConverterManager(Utility::Directory::join(args.value("plugin-dir"), "imageconverters/")); /* Load font */ - PluginManager::Manager fontManager(Utility::Directory::join(MAGNUM_PLUGINS_DIR, "fonts/")); + PluginManager::Manager fontManager(Utility::Directory::join(args.value("plugin-dir"), "fonts/")); if(!(fontManager.load(args.value("font")) & PluginManager::LoadState::Loaded)) std::exit(1); std::unique_ptr font = fontManager.instance(args.value("font")); /* Load font converter */ - PluginManager::Manager converterManager(Utility::Directory::join(MAGNUM_PLUGINS_DIR, "fontconverters/")); + PluginManager::Manager converterManager(Utility::Directory::join(args.value("plugin-dir"), "fontconverters/")); if(!(converterManager.load(args.value("converter")) & PluginManager::LoadState::Loaded)) std::exit(1); std::unique_ptr converter = converterManager.instance(args.value("converter")); From 644556bd855dbe741ea2a7068f9d92d08d53a702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:43:48 +0200 Subject: [PATCH 11/18] TextureTools: configurable plugin dir for distancefieldconverter utility. Similarly to magnum-fontconverter utility. --- src/Magnum/TextureTools/distancefieldconverter.cpp | 6 ++++-- .../TextureTools/distancefieldconverterConfigure.h.cmake | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Magnum/TextureTools/distancefieldconverter.cpp b/src/Magnum/TextureTools/distancefieldconverter.cpp index e15448bf4..c46b15a17 100644 --- a/src/Magnum/TextureTools/distancefieldconverter.cpp +++ b/src/Magnum/TextureTools/distancefieldconverter.cpp @@ -24,6 +24,7 @@ */ #include +#include #include #include "Magnum/Math/Range.h" @@ -66,6 +67,7 @@ DistanceFieldConverter::DistanceFieldConverter(const Arguments& arguments): Plat .addArgument("output").setHelp("output", "output image") .addOption("importer", "TgaImporter").setHelp("image importer plugin") .addOption("converter", "TgaImageConverter").setHelp("image converter plugin") + .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelpKey("plugin-dir", "DIR").setHelp("plugin-dir", "base plugin dir") .addNamedArgument("output-size").setHelpKey("output-size", "\"X Y\"").setHelp("output-size", "size of output image") .addNamedArgument("radius").setHelpKey("radius", "N").setHelp("radius", "distance field computation radius") .setHelp("Converts black&white image to distance-field representation.") @@ -76,13 +78,13 @@ DistanceFieldConverter::DistanceFieldConverter(const Arguments& arguments): Plat int DistanceFieldConverter::exec() { /* Load importer plugin */ - PluginManager::Manager importerManager(MAGNUM_IMPORTER_PLUGIN_DIR); + PluginManager::Manager importerManager(Utility::Directory::join(args.value("plugin-dir"), "importers/")); if(!(importerManager.load(args.value("importer")) & PluginManager::LoadState::Loaded)) return 1; std::unique_ptr importer = importerManager.instance(args.value("importer")); /* Load converter plugin */ - PluginManager::Manager converterManager(MAGNUM_IMAGECONVERTER_PLUGIN_DIR); + PluginManager::Manager converterManager(Utility::Directory::join(args.value("plugin-dir"), "imageconverters/")); if(!(converterManager.load(args.value("converter")) & PluginManager::LoadState::Loaded)) return 1; std::unique_ptr converter = converterManager.instance(args.value("converter")); diff --git a/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake b/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake index 8d6b08544..fa22c14a9 100644 --- a/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake +++ b/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake @@ -23,5 +23,4 @@ DEALINGS IN THE SOFTWARE. */ -#define MAGNUM_IMPORTER_PLUGIN_DIR "${MAGNUM_LIBRARY_INSTALL_DIR}/magnum/importers" -#define MAGNUM_IMAGECONVERTER_PLUGIN_DIR "${MAGNUM_LIBRARY_INSTALL_DIR}/magnum/imageconverters" +#define MAGNUM_PLUGINS_DIR "${MAGNUM_PLUGINS_INSTALL_DIR}" From 3442556ee0686c936ab723e2ef0f6a9bd6534c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:44:34 +0200 Subject: [PATCH 12/18] Minor code reorganization. --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c38630d..c70a6b0af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,6 +185,13 @@ endif() include(CorradeLibSuffix) set(MAGNUM_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin) set(MAGNUM_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) +set(MAGNUM_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum) +set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules) +set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) +set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumExternal) +set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumPlugins) + +# Separate install dirs for debug and release plugins set(MAGNUM_PLUGINS_DEBUG_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum-d) set(MAGNUM_PLUGINS_RELEASE_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum) set(MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/fonts) @@ -197,11 +204,6 @@ set(MAGNUM_PLUGINS_IMPORTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR set(MAGNUM_PLUGINS_IMPORTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/importers) set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/audioimporters) set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/audioimporters) -set(MAGNUM_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum) -set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules) -set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) -set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumExternal) -set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumPlugins) add_subdirectory(modules) add_subdirectory(src) From 8cea818d43fae450010141aeff82c5c63f37e0ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:45:17 +0200 Subject: [PATCH 13/18] Add back the missing MAGNUM_PLUGINS_INSTALL_DIR variable. Caused the utilities to have empty plugin dir by default. Broken since the debug/release library separation. --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c70a6b0af..34e71f6b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,6 +194,15 @@ set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumPlu # Separate install dirs for debug and release plugins set(MAGNUM_PLUGINS_DEBUG_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum-d) set(MAGNUM_PLUGINS_RELEASE_INSTALL_DIR ${MAGNUM_LIBRARY_INSTALL_DIR}/magnum) + +# Plugin installation dirs based on wheter we are in debug or release build, +# needed by some command-line tools +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(MAGNUM_PLUGINS_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}) +else() + set(MAGNUM_PLUGINS_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}) +endif() + set(MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/fonts) set(MAGNUM_PLUGINS_FONT_RELEASE_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_INSTALL_DIR}/fonts) set(MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}/fontconverters) From 7e4143f86bd83aec4c882f626da616a797ef1f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 10:46:25 +0200 Subject: [PATCH 14/18] Proper default plugin dir for debug on multi-configuration buildsystems. Similar logic to what we expose to the outside world. --- src/Magnum/Text/fontconverterConfigure.h.cmake | 4 ++++ .../TextureTools/distancefieldconverterConfigure.h.cmake | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Magnum/Text/fontconverterConfigure.h.cmake b/src/Magnum/Text/fontconverterConfigure.h.cmake index fa22c14a9..5fc249d4e 100644 --- a/src/Magnum/Text/fontconverterConfigure.h.cmake +++ b/src/Magnum/Text/fontconverterConfigure.h.cmake @@ -23,4 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#ifdef CORRADE_IS_DEBUG_BUILD +#define MAGNUM_PLUGINS_DIR "${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}" +#else #define MAGNUM_PLUGINS_DIR "${MAGNUM_PLUGINS_INSTALL_DIR}" +#endif diff --git a/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake b/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake index fa22c14a9..5fc249d4e 100644 --- a/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake +++ b/src/Magnum/TextureTools/distancefieldconverterConfigure.h.cmake @@ -23,4 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#ifdef CORRADE_IS_DEBUG_BUILD +#define MAGNUM_PLUGINS_DIR "${MAGNUM_PLUGINS_DEBUG_INSTALL_DIR}" +#else #define MAGNUM_PLUGINS_DIR "${MAGNUM_PLUGINS_INSTALL_DIR}" +#endif From c3df68aa28c71a1d18e9ce6e73719fcc9d1fa70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 12:39:31 +0200 Subject: [PATCH 15/18] doc: make section headers in class/function docs have sane size. Similar reasoning as in mosra/corrade@93b8308bc6a4def9d4564a6cea236cabe54fe063. --- doc/scenegraph.dox | 2 +- src/Magnum/AbstractFramebuffer.h | 3 ++- src/Magnum/AbstractResourceLoader.h | 2 +- src/Magnum/AbstractShaderProgram.h | 21 ++++++++++++------- src/Magnum/AbstractTexture.h | 5 +++-- src/Magnum/Audio/AbstractImporter.h | 2 +- src/Magnum/Buffer.h | 9 ++++---- src/Magnum/BufferTexture.h | 4 ++-- src/Magnum/CubeMapTexture.h | 2 +- src/Magnum/CubeMapTextureArray.h | 2 +- src/Magnum/DebugMessage.h | 2 +- src/Magnum/DebugTools/ForceRenderer.h | 7 ++++--- src/Magnum/DebugTools/ObjectRenderer.h | 7 ++++--- src/Magnum/DebugTools/ShapeRenderer.h | 7 ++++--- src/Magnum/DefaultFramebuffer.h | 5 +++-- src/Magnum/Framebuffer.h | 5 +++-- src/Magnum/Math/Angle.h | 4 ++-- src/Magnum/Mesh.h | 20 ++++++++++-------- src/Magnum/MultisampleTexture.h | 2 +- src/Magnum/Platform/Screen.h | 2 +- src/Magnum/Platform/ScreenedApplication.h | 2 +- src/Magnum/RectangleTexture.h | 2 +- src/Magnum/Renderbuffer.h | 2 +- src/Magnum/ResourceManager.h | 2 +- src/Magnum/SceneGraph/AbstractCamera.h | 9 ++++---- src/Magnum/SceneGraph/AbstractFeature.h | 11 +++++----- .../SceneGraph/AbstractGroupedFeature.h | 6 +++--- src/Magnum/SceneGraph/AbstractObject.h | 9 ++++---- .../SceneGraph/AbstractTransformation.h | 5 +++-- src/Magnum/SceneGraph/Animable.h | 6 +++--- src/Magnum/SceneGraph/Camera2D.h | 7 ++++--- src/Magnum/SceneGraph/Camera3D.h | 7 ++++--- src/Magnum/SceneGraph/Drawable.h | 6 +++--- src/Magnum/SceneGraph/Object.h | 9 ++++---- src/Magnum/Shader.h | 2 +- src/Magnum/Shaders/MeshVisualizer.h | 2 +- src/Magnum/Text/AbstractFont.h | 6 +++--- src/Magnum/Text/AbstractFontConverter.h | 2 +- src/Magnum/Text/DistanceFieldGlyphCache.h | 2 +- src/Magnum/Text/GlyphCache.h | 2 +- src/Magnum/Text/Renderer.h | 4 ++-- src/Magnum/Texture.h | 2 +- src/Magnum/TextureArray.h | 2 +- src/Magnum/TextureTools/DistanceField.h | 4 +++- src/Magnum/Timeline.h | 2 +- src/Magnum/Trade/AbstractImageConverter.h | 2 +- src/Magnum/Trade/AbstractImporter.h | 2 +- 47 files changed, 128 insertions(+), 102 deletions(-) diff --git a/doc/scenegraph.dox b/doc/scenegraph.dox index 85ec71c42..3a410b60b 100644 --- a/doc/scenegraph.dox +++ b/doc/scenegraph.dox @@ -227,7 +227,7 @@ by calling @ref Object::setClean(). @ref Camera3D "Camera", for example, calls it automatically before it starts rendering, as it needs its own inverse transformation to properly draw the objects. -See @ref AbstractFeature-subclassing-caching for more information. +See @ref SceneGraph-AbstractFeature-subclassing-caching for more information. @section scenegraph-construction-order Construction and destruction order diff --git a/src/Magnum/AbstractFramebuffer.h b/src/Magnum/AbstractFramebuffer.h index 13678bdbd..7ab04f1d2 100644 --- a/src/Magnum/AbstractFramebuffer.h +++ b/src/Magnum/AbstractFramebuffer.h @@ -152,7 +152,8 @@ namespace Implementation { struct FramebufferState; } See @ref DefaultFramebuffer and @ref Framebuffer for more information. -@section AbstractFramebuffer-performance-optimization Performance optimizations and security +@anchor AbstractFramebuffer-performance-optimization +## Performance optimizations and security The engine tracks currently bound framebuffer and current viewport to avoid unnecessary calls to @fn_gl{BindFramebuffer} and @fn_gl{Viewport} when diff --git a/src/Magnum/AbstractResourceLoader.h b/src/Magnum/AbstractResourceLoader.h index ba24ebb8a..190b1722b 100644 --- a/src/Magnum/AbstractResourceLoader.h +++ b/src/Magnum/AbstractResourceLoader.h @@ -40,7 +40,7 @@ namespace Magnum { Provides (a)synchronous resource loading for @ref ResourceManager. -@section AbstractResourceLoader-usage Usage and subclassing +## Usage and subclassing Usage is done by subclassing. Subclass instances can be added to @ref ResourceManager using @ref ResourceManager::setLoader(). After adding the diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index 207a80846..0957857e1 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -46,7 +46,8 @@ namespace Implementation { /** @brief Base for shader program implementations -@section AbstractShaderProgram-subclassing Subclassing workflow +@anchor AbstractShaderProgram-subclassing +## Subclassing workflow This class is designed to be used via subclassing. Subclasses define these functions and properties: @@ -116,7 +117,8 @@ MyShader& setSpecularTexture(Texture2D& texture) { } @endcode -@subsection AbstractShaderProgram-attribute-location Binding attribute location +@anchor AbstractShaderProgram-attribute-location +### Binding attribute location The preferred workflow is to specify attribute location for vertex shader input attributes and fragment shader output attributes explicitly in the shader code, @@ -184,7 +186,8 @@ bindFragmentDataLocationIndexed(NormalOutput, 1, "normal"); @todo @es_extension{EXT,separate_shader_objects} supports explicit attrib location -@subsection AbstractShaderProgram-uniform-location Uniform locations +@anchor AbstractShaderProgram-uniform-location +### Uniform locations The preferred workflow is to specify uniform locations directly in the shader code, e.g.: @@ -219,7 +222,8 @@ Int normalMatrixUniform = uniformLocation("normalMatrix"); @ref Magnum::AbstractShaderProgram::uniformLocation() "uniformLocation()" instead. -@subsection AbstractShaderProgram-texture-units Specifying texture binding units +@anchor AbstractShaderProgram-texture-units +### Specifying texture binding units The preferred workflow is to specify texture binding unit directly in the shader code, e.g.: @@ -251,7 +255,8 @@ setUniform(uniformLocation("specularTexture"), 1); @ref Magnum::AbstractShaderProgram::setUniform(Int, const T&) "setUniform(Int, Int)" instead. -@section AbstractShaderProgram-rendering-workflow Rendering workflow +@anchor AbstractShaderProgram-rendering-workflow +## Rendering workflow Basic workflow with %AbstractShaderProgram subclasses is: instance shader class, configure attribute binding in meshes (see @ref Mesh-configuration "Mesh documentation" @@ -268,7 +273,8 @@ shader.setTransformation(transformation) mesh.draw(shader); @endcode -@section AbstractShaderProgram-types Mapping between GLSL and Magnum types +@anchor AbstractShaderProgram-types +## Mapping between GLSL and %Magnum types See @ref types for more information, only types with GLSL equivalent can be used (and their super- or subclasses with the same size and underlying type). See @@ -306,7 +312,8 @@ also @ref Attribute::DataType enum for additional type options. @ref Magnum::Matrix4x3 "Matrix4x3") are not available in OpenGL ES 2.0. @requires_gl Double attributes and uniforms are not available in OpenGL ES. -@section AbstractShaderProgram-performance-optimization Performance optimizations +@anchor AbstractShaderProgram-performance-optimization +## Performance optimizations %Shader limits (such as @ref maxVertexAttributes()) are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 58032d5aa..56c8164c5 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -56,13 +56,14 @@ Encapsulates one OpenGL texture object. See @ref Texture, @ref TextureArray, @ref BufferTexture and @ref MultisampleTexture documentation for more information and usage examples. -@section AbstractTexture-webgl-restrictions WebGL restrictions +## WebGL restrictions @ref MAGNUM_TARGET_WEBGL "WebGL" puts some restrictions on type of data submitted to @ref Texture::setSubImage() "*Texture::setSubImage()", see its documentation for details. -@section AbstractTexture-performance-optimization Performance optimizations and security +@anchor AbstractTexture-performance-optimization +## Performance optimizations and security The engine tracks currently bound textures in all available texture units to avoid unnecessary calls to @fn_gl{ActiveTexture} and @fn_gl{BindTexture}. diff --git a/src/Magnum/Audio/AbstractImporter.h b/src/Magnum/Audio/AbstractImporter.h index 7bf4ad532..429253d11 100644 --- a/src/Magnum/Audio/AbstractImporter.h +++ b/src/Magnum/Audio/AbstractImporter.h @@ -43,7 +43,7 @@ Provides interface for importing various audio formats. See @ref plugins for more information and `*Importer` classes in @ref Audio namespace for available importer plugins. -@section Audio-AbstractImporter-subclassing Subclassing +## Subclassing Plugin implements function @ref doFeatures(), @ref doIsOpened(), one of or both @ref doOpenData() and @ref doOpenFile() functions, function @ref doClose() and diff --git a/src/Magnum/Buffer.h b/src/Magnum/Buffer.h index a993584a2..cc9d24d13 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/Buffer.h @@ -122,7 +122,7 @@ namespace Implementation { struct BufferState; } Encapsulates one OpenGL buffer object and provides functions for convenient data updates. -@section Buffer-data Data updating +## Data updating Default way to set or update buffer data with @ref setData() or @ref setSubData() is to use @ref Corrade::Containers::ArrayReference. See its documentation for @@ -138,7 +138,8 @@ std::vector data; buffer.setData(data, BufferUsage::StaticDraw); @endcode -@subsection Buffer-data-mapping Memory mapping +@anchor Buffer-data-mapping +## Memory mapping %Buffer data can be also updated asynchronously. First you need to allocate the buffer to desired size by passing `nullptr` to @ref setData(), e.g.: @@ -166,7 +167,7 @@ for(std::size_t i: {7, 27, 56, 128}) { CORRADE_INTERNAL_ASSERT_OUTPUT(buffer.unmap()); @endcode -@section Buffer-webgl-restrictions WebGL and NaCl restrictions +## WebGL and NaCl restrictions Buffers in @ref MAGNUM_TARGET_WEBGL "WebGL" and @ref CORRADE_TARGET_NACL "NaCl" need to be bound only to one unique target, i.e., @ref Buffer bound to @@ -183,7 +184,7 @@ Buffer indices{Buffer::Target::ElementArray}; To ease up the development, @ref Mesh checks proper target hint when adding vertex and index buffers in both WebGL and NaCl. -@section Buffer-performance-optimization Performance optimizations +## Performance optimizations The engine tracks currently bound buffers to avoid unnecessary calls to @fn_gl{BindBuffer}. If the buffer is already bound to some target, functions diff --git a/src/Magnum/BufferTexture.h b/src/Magnum/BufferTexture.h index 987695d98..980aae547 100644 --- a/src/Magnum/BufferTexture.h +++ b/src/Magnum/BufferTexture.h @@ -157,7 +157,7 @@ enum class BufferTextureFormat: GLenum { This texture is, unlike classic textures such as @ref Texture used as simple data source, without any unnecessary interpolation and wrapping methods. -@section BufferTexture-usage Usage +## Usage %Texture data are stored in buffer and after binding the buffer to the texture using @ref setBuffer(), you can fill the buffer at any time using data setting @@ -185,7 +185,7 @@ In shader, the texture is used via `samplerBuffer`, `isamplerBuffer` or are integer coordinates passed to `texelFetch()`. See @ref AbstractShaderProgram documentation for more information about usage in shaders. -@section BufferTexture-performance-optimization Performance optimizations +## Performance optimizations If extension @extension{EXT,direct_state_access} is available, @ref setBuffer() functions use DSA to avoid unnecessary calls to @fn_gl{ActiveTexture} and diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 59d7ad2e6..087c3e1ae 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -50,7 +50,7 @@ turned upside down (+Y is top): | +Y | +----+ -@section CubeMapTexture-usage Basic usage +## Basic usage See @ref Texture documentation for introduction. diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index 7349f1d8e..22230f084 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -43,7 +43,7 @@ namespace Magnum { See @ref CubeMapTexture documentation for introduction. -@section CubeMapTextureArray-usage Usage +## Usage See @ref Texture documentation for introduction. diff --git a/src/Magnum/DebugMessage.h b/src/Magnum/DebugMessage.h index c7fafa951..217ebbc68 100644 --- a/src/Magnum/DebugMessage.h +++ b/src/Magnum/DebugMessage.h @@ -46,7 +46,7 @@ Allows retrieving and inserting debug messages from and to OpenGL command stream, for example with conjunction with various debuggers, such as Apitrace or gDEBugger. -@section DebugMessage-usage Basic usage +## Basic usage To retrieve debug messages from either the GL or your application you need to have OpenGL 4.3 or @extension{KHR,debug} desktop/ES extension. You need to diff --git a/src/Magnum/DebugTools/ForceRenderer.h b/src/Magnum/DebugTools/ForceRenderer.h index 3282f575b..19411ff2b 100644 --- a/src/Magnum/DebugTools/ForceRenderer.h +++ b/src/Magnum/DebugTools/ForceRenderer.h @@ -85,7 +85,8 @@ class ForceRendererOptions { Visualizes force pushing on object by an arrow of the same direction and size. See @ref debug-tools-renderers for more information. -@section ForceRenderer-usage Basic usage +@anchor DebugTools-ForceRenderer-usage +## Basic usage Example code: @code @@ -109,8 +110,8 @@ template class MAGNUM_DEBUGTOOLS_EXPORT ForceRenderer: p * @param forcePosition Where to render the force, relative to object * @param force Force vector * @param options Options resource key. See - * @ref ForceRenderer-usage "class documentation" for more - * information. + * @ref DebugTools-ForceRenderer-usage "class documentation" for + * more information. * @param drawables Drawable group * * The renderer is automatically added to object's features, @p force is diff --git a/src/Magnum/DebugTools/ObjectRenderer.h b/src/Magnum/DebugTools/ObjectRenderer.h index eaeed85f1..a85806131 100644 --- a/src/Magnum/DebugTools/ObjectRenderer.h +++ b/src/Magnum/DebugTools/ObjectRenderer.h @@ -69,7 +69,8 @@ class ObjectRendererOptions { Visualizes object position, rotation and scale using colored axes. See @ref debug-tools-renderers for more information. -@section ObjectRenderer-usage Basic usage +@anchor DebugTools-ObjectRenderer-usage +## Basic usage Example code: @code @@ -89,8 +90,8 @@ template class MAGNUM_DEBUGTOOLS_EXPORT ObjectRenderer: * @brief Constructor * @param object Object for which to create debug renderer * @param options Options resource key. See - * @ref ObjectRenderer-usage "class documentation" for more - * information. + * @ref DebugTools-ObjectRenderer-usage "class documentation" for + * more information. * @param drawables Drawable group * * The renderer is automatically added to object's features. diff --git a/src/Magnum/DebugTools/ShapeRenderer.h b/src/Magnum/DebugTools/ShapeRenderer.h index 27cc1df29..719b6beca 100644 --- a/src/Magnum/DebugTools/ShapeRenderer.h +++ b/src/Magnum/DebugTools/ShapeRenderer.h @@ -120,7 +120,8 @@ class ShapeRendererOptions { Visualizes collision shapes using wireframe primitives. See @ref debug-tools-renderers for more information. -@section ShapeRenderer-usage Basic usage +@anchor DebugTools-ShapeRenderer-usage +## Basic usage Example code: @code @@ -147,8 +148,8 @@ template class MAGNUM_DEBUGTOOLS_EXPORT ShapeRenderer: p * @brief Constructor * @param shape Shape for which to create debug renderer * @param options Options resource key. See - * @ref ShapeRenderer-usage "class documentation" for more - * information. + * @ref DebugTools-ShapeRenderer-usage "class documentation" for + * more information. * @param drawables Drawable group * * The renderer is automatically added to shape's object features, diff --git a/src/Magnum/DefaultFramebuffer.h b/src/Magnum/DefaultFramebuffer.h index 98fec42de..db2b87b76 100644 --- a/src/Magnum/DefaultFramebuffer.h +++ b/src/Magnum/DefaultFramebuffer.h @@ -41,7 +41,8 @@ created when @ref Context is created and it is available through global variable @ref defaultFramebuffer. It is by default mapped to whole screen surface. -@section DefaultFramebuffer-usage Usage +@anchor DefaultFramebuffer-usage +## Usage When you are using only the default framebuffer, the usage is simple. You must ensure that it is properly resized when application surface is resized, @@ -69,7 +70,7 @@ void drawEvent() { See Framebuffer documentation for more involved usage, usage of non-default or multiple framebuffers. -@section DefaultFramebuffer-performance-optimization Performance optimizations +## Performance optimizations See also @ref AbstractFramebuffer-performance-optimization "relevant section in AbstractFramebuffer". diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/Framebuffer.h index 1e2e72a3b..79d75d125 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/Framebuffer.h @@ -45,7 +45,8 @@ Unlike @ref DefaultFramebuffer, which is used for on-screen rendering, this class is used for off-screen rendering, usable either in windowless applications, texture generation or for various post-processing effects. -@section Framebuffer-usage Example usage +@anchor Framebuffer-usage +## Example usage See @ref DefaultFramebuffer-usage "DefaultFramebuffer documentation" for introduction. Imagine you have shader with multiple outputs (e.g. for deferred @@ -88,7 +89,7 @@ void drawEvent() { } @endcode -@section Framebuffer-performance-optimization Performance optimizations +## Performance optimizations See also @ref AbstractFramebuffer-performance-optimization "relevant section in AbstractFramebuffer". diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index d92ef23a5..17ec3cf50 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -45,7 +45,7 @@ namespace Magnum { namespace Math { Along with Rad provides convenience classes to make angle specification and conversion less error-prone. -@section Rad-usage Usage +## Usage You can enter the value either by using literal: @code @@ -92,7 +92,7 @@ Float d = Double(b); // 60.0 //Float e = b; // error, no implicit conversion @endcode -@section Rad-conversions Requirement of explicit conversion +## Requirement of explicit conversion The requirement of explicit conversions from and to unitless types helps to reduce unit-based errors. Consider following example with implicit conversions diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index d37831ae6..c2d40b3fb 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -120,7 +120,8 @@ namespace Implementation { struct MeshState; } /** @brief %Mesh -@section Mesh-configuration Mesh configuration +@anchor Mesh-configuration +## %Mesh configuration You have to specify at least primitive and vertex/index count using @ref setPrimitive() and @ref setCount(). Then fill your vertex buffers with @@ -146,9 +147,9 @@ different usage) or store data for more meshes in one buffer. If vertex/index count or instance count is zero, the mesh is empty and no draw commands are issued when calling @ref draw(). -@subsection Mesh-configuration-examples Example mesh configuration +### Example mesh configuration -@subsubsection Mesh-configuration-examples-nonindexed Basic non-indexed mesh +#### Basic non-indexed mesh @code // Custom shader, needing only position data @@ -173,7 +174,7 @@ mesh.setPrimitive(MeshPrimitive::Triangles) .addVertexBuffer(vertexBuffer, 0, MyShader::Position{}); @endcode -@subsubsection Mesh-configuration-examples-nonindexed-phong Interleaved vertex data +#### Interleaved vertex data @code // Non-indexed primitive with positions and normals @@ -190,7 +191,7 @@ mesh.setPrimitive(plane.primitive()) .addVertexBuffer(buffer, 0, Shaders::Phong::Position{}, Shaders::Phong::Normal{}); @endcode -@subsubsection Mesh-configuration-examples-indexed-phong Indexed mesh +#### Indexed mesh @code // Custom shader @@ -254,7 +255,7 @@ mesh.setPrimitive(plane.primitive()) Or, if you plan to use the mesh with stock shaders, you can just use @ref MeshTools::compile(). -@subsubsection Mesh-configuration-examples-data-options Specific formats of vertex data +#### Specific formats of vertex data @code // Custom shader with colors specified as four floating-point values @@ -300,19 +301,20 @@ mesh.addVertexBuffer(colorBuffer, 0, MyShader::Color{ MyShader::Color::DataOption::Normalized}); @endcode -@section Mesh-drawing Rendering meshes +## Rendering meshes Basic workflow is: bind specific framebuffer for drawing (if needed), set up respective shader (see @ref AbstractShaderProgram-rendering-workflow "AbstractShaderProgram documentation" for more infromation) and call @ref Mesh::draw(). -@section Mesh-webgl-restrictions WebGL restrictions +## WebGL restrictions @ref MAGNUM_TARGET_WEBGL "WebGL" puts some restrictions on vertex buffer layout, see @ref addVertexBuffer() documentation for details. -@section Mesh-performance-optimization Performance optimizations +@anchor Mesh-performance-optimization +## Performance optimizations If @extension{APPLE,vertex_array_object} (part of OpenGL 3.0), OpenGL ES 3.0 or @es_extension{OES,vertex_array_object} on OpenGL ES 2.0 is supported, VAOs are diff --git a/src/Magnum/MultisampleTexture.h b/src/Magnum/MultisampleTexture.h index dfee8ffb5..54c4e1038 100644 --- a/src/Magnum/MultisampleTexture.h +++ b/src/Magnum/MultisampleTexture.h @@ -65,7 +65,7 @@ Template class for 2D mulitsample texture and 2D multisample texture array. Used only from shaders for manual multisample resolve and other operations. See also @ref AbstractTexture documentation for more information. -@section MultisampleTexture-usage Usage +## Usage As multisample textures have no sampler state, the only thing you need is to set storage: diff --git a/src/Magnum/Platform/Screen.h b/src/Magnum/Platform/Screen.h index 1178e9a2b..a266713d8 100644 --- a/src/Magnum/Platform/Screen.h +++ b/src/Magnum/Platform/Screen.h @@ -53,7 +53,7 @@ See @ref BasicScreenedApplication for more information. If exactly one application header is included, this class is also aliased to `Platform::Screen`. -@section Screen-explicit-specializations Explicit template specializations +## Explicit template specializations The following specialization are explicitly compiled into each particular `*Application` library. For other specializations you have to use diff --git a/src/Magnum/Platform/ScreenedApplication.h b/src/Magnum/Platform/ScreenedApplication.h index 0ab66a5e8..f64953439 100644 --- a/src/Magnum/Platform/ScreenedApplication.h +++ b/src/Magnum/Platform/ScreenedApplication.h @@ -75,7 +75,7 @@ for(Screen* s = app.backScreen(); s; s = s->nextNearerScreen()) { } @endcode -@section ScreenedApplication-explicit-specializations Explicit template specializations +## Explicit template specializations The following specialization are explicitly compiled into each particular `*Application` library. For other specializations you have to use diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index 02c1aa0a5..3bea9918d 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -43,7 +43,7 @@ namespace Magnum { See also @ref AbstractTexture documentation for more information. -@section RectangleTexture-usage Usage +## Usage Common usage is to fully configure all texture parameters and then set the data from e.g. @ref Image2D. Example configuration: diff --git a/src/Magnum/Renderbuffer.h b/src/Magnum/Renderbuffer.h index febb72670..33b82bf11 100644 --- a/src/Magnum/Renderbuffer.h +++ b/src/Magnum/Renderbuffer.h @@ -42,7 +42,7 @@ namespace Implementation { struct FramebufferState; } Attachable to framebuffer as render target, see @ref Framebuffer documentation for more information. -@section Renderbuffer-performance-optimization Performance optimizations +## Performance optimizations The engine tracks currently bound renderbuffer to avoid unnecessary calls to @fn_gl{BindRenderbuffer} in @ref setStorage(). %Renderbuffer limits and diff --git a/src/Magnum/ResourceManager.h b/src/Magnum/ResourceManager.h index 756be7fd8..921d9b0fb 100644 --- a/src/Magnum/ResourceManager.h +++ b/src/Magnum/ResourceManager.h @@ -163,7 +163,7 @@ template class ResourceManagerData { Provides storage for arbitrary set of types, accessible globally using @ref instance(). -@section ResourceManager-usage Usage +## Usage Each resource is referenced from @ref Resource class. For optimizing performance, each resource can be set as mutable or final. Mutable resources diff --git a/src/Magnum/SceneGraph/AbstractCamera.h b/src/Magnum/SceneGraph/AbstractCamera.h index fc2e01e4c..c6e8449de 100644 --- a/src/Magnum/SceneGraph/AbstractCamera.h +++ b/src/Magnum/SceneGraph/AbstractCamera.h @@ -58,13 +58,14 @@ See Drawable documentation for more information. This class is not directly instantiatable, use @ref BasicCamera2D or @ref BasicCamera3D subclasses instead. -@section AbstractCamera-explicit-specializations Explicit template specializations +@anchor SceneGraph-AbstractCamera-explicit-specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to use @ref AbstractCamera.hpp implementation file to avoid linker errors. See -also relevant sections in @ref Camera2D-explicit-specializations "Camera2D" -and @ref Camera3D-explicit-specializations "Camera3D" class documentation or +also relevant sections in @ref SceneGraph-Camera2D-explicit-specializations "Camera2D" +and @ref SceneGraph-Camera3D-explicit-specializations "Camera3D" class documentation or @ref compilation-speedup-hpp for more information. - @ref AbstractCamera2D diff --git a/src/Magnum/SceneGraph/AbstractFeature.h b/src/Magnum/SceneGraph/AbstractFeature.h index c2c9fe89c..2f705bf13 100644 --- a/src/Magnum/SceneGraph/AbstractFeature.h +++ b/src/Magnum/SceneGraph/AbstractFeature.h @@ -84,13 +84,14 @@ Contained in @ref Object, takes care of transformation caching. See Uses @ref Corrade::Containers::LinkedList for accessing holder object and sibling features. -@section AbstractFeature-subclassing Subclassing +## Subclassing Feature is templated on dimension count and underlying transformation type, so it can be used only on object having transformation with the same dimension count and type. -@subsection AbstractFeature-subclassing-caching Caching transformations in features +@anchor SceneGraph-AbstractFeature-subclassing-caching +### Caching transformations in features Features can cache absolute transformation of the object instead of computing it from scratch every time to achieve better performance. See @@ -120,7 +121,7 @@ class CachingFeature: public SceneGraph::AbstractFeature3D { Before using the cached value explicitly request object cleaning by calling `object()->setClean()`. -@subsection AbstractFeature-subclassing-transformation Accessing object transformation +### Accessing object transformation Features has by default access only to @ref AbstractObject, which is base of @ref Object not depending on any particular transformation implementation. This @@ -150,9 +151,9 @@ from @ref AbstractBasicTranslationRotationScaling3D "AbstractTranslationRotation which is derived from @ref AbstractBasicTranslationRotation3D "AbstractTranslationRotation3D", which is automatically extracted from the reference in our constructor. -@section AbstractFeature-explicit-specializations Explicit template specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to use @ref AbstractFeature.hpp implementation file to avoid linker errors. See also @ref compilation-speedup-hpp for more information. diff --git a/src/Magnum/SceneGraph/AbstractGroupedFeature.h b/src/Magnum/SceneGraph/AbstractGroupedFeature.h index 5e1c075ac..40893355d 100644 --- a/src/Magnum/SceneGraph/AbstractGroupedFeature.h +++ b/src/Magnum/SceneGraph/AbstractGroupedFeature.h @@ -41,7 +41,7 @@ namespace Magnum { namespace SceneGraph { Used together with @ref FeatureGroup. -@section AbstractGroupedFeature-subclassing Subclassing +## Subclassing Usage is via subclassing the feature using [CRTP](http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern) and typedef'ing @ref FeatureGroup to accept only given type, e.g.: @@ -53,9 +53,9 @@ class Drawable: public SceneGraph::AbstractGroupedFeature3D { typedef SceneGraph::FeatureGroup3D DrawableGroup; @endcode -@section AbstractGroupedFeature-explicit-specializations Explicit template specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to use @ref FeatureGroup.hpp implementation file to avoid linker errors. See also @ref compilation-speedup-hpp for more information. diff --git a/src/Magnum/SceneGraph/AbstractObject.h b/src/Magnum/SceneGraph/AbstractObject.h index 82ad3863c..ea2de20c5 100644 --- a/src/Magnum/SceneGraph/AbstractObject.h +++ b/src/Magnum/SceneGraph/AbstractObject.h @@ -55,13 +55,14 @@ for(AbstractFeature* feature = o->firstFeature(); feature; feature = feature->ne } @endcode -@section AbstractObject-explicit-specializations Explicit template specializations +@anchor SceneGraph-AbstractObject-explicit-specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to use @ref Object.hpp implementation file to avoid linker errors. See also -relevant sections in @ref Object-explicit-specializations "Object" and -@ref AbstractTransformation-explicit-specializations "AbstractTransformation" +relevant sections in @ref SceneGraph-Object-explicit-specializations "Object" and +@ref SceneGraph-AbstractTransformation-explicit-specializations "AbstractTransformation" class documentation or @ref compilation-speedup-hpp for more information. - @ref AbstractObject2D diff --git a/src/Magnum/SceneGraph/AbstractTransformation.h b/src/Magnum/SceneGraph/AbstractTransformation.h index 9be1d7e56..c9298baa6 100644 --- a/src/Magnum/SceneGraph/AbstractTransformation.h +++ b/src/Magnum/SceneGraph/AbstractTransformation.h @@ -39,9 +39,10 @@ namespace Magnum { namespace SceneGraph { Provides transformation implementation for @ref Object instances. -@section AbstractTransformation-explicit-specializations Explicit template specializations +@anchor SceneGraph-AbstractTransformation-explicit-specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to use @ref Object.hpp implementation file to avoid linker errors. See @ref compilation-speedup-hpp for more information. diff --git a/src/Magnum/SceneGraph/Animable.h b/src/Magnum/SceneGraph/Animable.h index 50deae124..0573da9c2 100644 --- a/src/Magnum/SceneGraph/Animable.h +++ b/src/Magnum/SceneGraph/Animable.h @@ -65,7 +65,7 @@ Debug MAGNUM_SCENEGRAPH_EXPORT operator<<(Debug debug, AnimationState value); Adds animation feature to object. Each %Animable is part of some @ref AnimableGroup, which takes care of running the animations. -@section Animable-usage Usage +## Usage First thing is to add @ref Animable feature to some object and implement @ref animationStep(). You can do it conveniently using multiple inheritance @@ -120,7 +120,7 @@ void MyApplication::drawEvent() { } @endcode -@section Animable-performance Using animable groups to improve performance +## Using animable groups to improve performance @ref AnimableGroup is optimized for case when no animation is running -- it just puts itself to rest and waits until some animation changes its state to @@ -128,7 +128,7 @@ just puts itself to rest and waits until some animation changes its state to pernamently running to separate group, they will not be always traversed when calling @ref AnimableGroup::step(), saving precious frame time. -@section Animable-explicit-specializations Explicit template specializations +## Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to diff --git a/src/Magnum/SceneGraph/Camera2D.h b/src/Magnum/SceneGraph/Camera2D.h index 2706d403a..1ed624b46 100644 --- a/src/Magnum/SceneGraph/Camera2D.h +++ b/src/Magnum/SceneGraph/Camera2D.h @@ -45,12 +45,13 @@ camera.setProjection({4.0f/3.0f, 1.0f}) .setAspectRatioPolicy(SceneGraph::AspectRatioPolicy::Extend); @endcode -@section Camera2D-explicit-specializations Explicit template specializations +@anchor SceneGraph-Camera2D-explicit-specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specialization is explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to use @ref Camera2D.hpp implementation file to avoid linker errors. See also -relevant section in @ref AbstractCamera-explicit-specializations "AbstractCamera" +relevant section in @ref SceneGraph-AbstractCamera-explicit-specializations "AbstractCamera" class documentation or @ref compilation-speedup-hpp for more information. - @ref Camera2D diff --git a/src/Magnum/SceneGraph/Camera3D.h b/src/Magnum/SceneGraph/Camera3D.h index a90507241..67e517a89 100644 --- a/src/Magnum/SceneGraph/Camera3D.h +++ b/src/Magnum/SceneGraph/Camera3D.h @@ -50,12 +50,13 @@ camera.setPerspective({}, 0.001f, 100.0f) .setAspectRatioPolicy(SceneGraph::AspectRatioPolicy::Extend); @endcode -@section Camera3D-explicit-specializations Explicit template specializations +@anchor SceneGraph-Camera3D-explicit-specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specialization is explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to use @ref Camera3D.hpp implementation file to avoid linker errors. See also -relevant section in @ref AbstractCamera-explicit-specializations "AbstractCamera" +relevant section in @ref SceneGraph-AbstractCamera-explicit-specializations "AbstractCamera" class documentation or @ref compilation-speedup-hpp for more information. - @ref Camera3D diff --git a/src/Magnum/SceneGraph/Drawable.h b/src/Magnum/SceneGraph/Drawable.h index 8f27706a6..8763ddf07 100644 --- a/src/Magnum/SceneGraph/Drawable.h +++ b/src/Magnum/SceneGraph/Drawable.h @@ -40,7 +40,7 @@ Adds drawing function to the object. Each %Drawable is part of some @ref DrawableGroup and the whole group is drawn with particular camera using @ref AbstractCamera::draw(). -@section Drawable-usage Usage +## Usage First thing is to add @ref Drawable feature to some object and implement @ref draw(). You can do it conveniently using multiple inheritance (see @@ -91,7 +91,7 @@ void MyApplication::drawEvent() { } @endcode -@section Drawable-performance Using drawable groups to improve performance +## Using drawable groups to improve performance You can organize your drawables to multiple groups to minimize OpenGL state changes -- for example put all objects using the same shader, the same light @@ -117,7 +117,7 @@ void MyApplication::drawEvent() { } @endcode -@section Drawable-explicit-specializations Explicit template specializations +## Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type) you have to diff --git a/src/Magnum/SceneGraph/Object.h b/src/Magnum/SceneGraph/Object.h index 929bafb67..bfd834b1e 100644 --- a/src/Magnum/SceneGraph/Object.h +++ b/src/Magnum/SceneGraph/Object.h @@ -72,14 +72,15 @@ for(Object* child = o->firstChild(); child; child = child->nextSibling()) { } @endcode -@section Object-explicit-specializations Explicit template specializations +@anchor SceneGraph-Object-explicit-specializations +## Explicit template specializations -The following specialization are explicitly compiled into @ref SceneGraph +The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Double type or special transformation class) you have to use @ref Object.hpp implementation file to avoid linker errors. See also relevant sections in -@ref AbstractObject-explicit-specializations "AbstractObject" and -@ref AbstractTransformation-explicit-specializations "AbstractTransformation" +@ref SceneGraph-AbstractObject-explicit-specializations "AbstractObject" and +@ref SceneGraph-AbstractTransformation-explicit-specializations "AbstractTransformation" class documentation or @ref compilation-speedup-hpp for more information. - @ref DualComplexTransformation "Object" diff --git a/src/Magnum/Shader.h b/src/Magnum/Shader.h index eeaf47cd0..55525e4e3 100644 --- a/src/Magnum/Shader.h +++ b/src/Magnum/Shader.h @@ -45,7 +45,7 @@ See @ref AbstractShaderProgram for more information. @todoc Usage... -@section Shader-performance-optimization Performance optimizations +## Performance optimizations %Shader limits and implementation-defined values (such as @ref maxUniformComponents()) are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. diff --git a/src/Magnum/Shaders/MeshVisualizer.h b/src/Magnum/Shaders/MeshVisualizer.h index 594e3409c..8d8d0a26d 100644 --- a/src/Magnum/Shaders/MeshVisualizer.h +++ b/src/Magnum/Shaders/MeshVisualizer.h @@ -44,7 +44,7 @@ Uses geometry shader to visualize wireframe. You need to provide @ref Position attribute in your triangle mesh and call at least @ref setTransformationProjectionMatrix() to be able to render. -@section ShadersMeshVisualizer-wireframe Wireframe visualization +## Wireframe visualization Wireframe visualization is done by enabling @ref Flag::Wireframe. It is done either using geometry shaders or with help of additional vertex information. diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index c4081783e..e903cef6f 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -48,14 +48,14 @@ Provides interface for opening fonts, filling glyph cache and layouting the glyphs. See @ref plugins for more information and `*Font` classes in @ref Text namespace for available font plugins. -@section AbstractFont-usage Usage +## Usage First step is to open the font using @ref openData(), @ref openSingleData() or @ref openFile(). Next step is to prerender all the glyphs which will be used in text rendering later, see @ref GlyphCache for more information. See @ref Renderer for information about text rendering. -@section AbstractFont-subclassing Subclassing +## Subclassing Plugin implements @ref doFeatures(), @ref doClose(), @ref doLayout(), either @ref doCreateGlyphCache() or @ref doFillGlyphCache() and one or more of @@ -304,7 +304,7 @@ CORRADE_ENUMSET_OPERATORS(AbstractFont::Features) Returned by @ref AbstractFont::layout(). -@section TextAbstractLayouter-subclassing Subclassing +## Subclassing Plugin creates private subclass (no need to expose it to end users) and implements @ref doRenderGlyph(). Bounds checking on @p i is done automatically diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index dffa6958d..7df3c89e4 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -45,7 +45,7 @@ Provides functionality for converting arbitrary font to different format. See @ref plugins for more information and `*FontConverter` classes in @ref Text namespace for available font converter plugins. -@section AbstractFontConverter-subclassing Subclassing +## Subclassing Plugin implements @ref doFeatures() and one or more of `exportTo*()` / `importFrom*()` functions based on what features are supported. Characters diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.h b/src/Magnum/Text/DistanceFieldGlyphCache.h index 436d25812..0bbd24639 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.h +++ b/src/Magnum/Text/DistanceFieldGlyphCache.h @@ -40,7 +40,7 @@ Unlike original @ref GlyphCache converts each binary image to distance field. It is not possible to use non-binary colors with this cache, internal texture format is red channel only. -@section DistanceFieldGlyphCache-usage Usage +## Usage Usage is similar to @ref GlyphCache, additionally you need to specify size of resulting distance field texture. diff --git a/src/Magnum/Text/GlyphCache.h b/src/Magnum/Text/GlyphCache.h index df1923c05..5a327d9d3 100644 --- a/src/Magnum/Text/GlyphCache.h +++ b/src/Magnum/Text/GlyphCache.h @@ -43,7 +43,7 @@ namespace Magnum { namespace Text { Contains font glyphs prerendered into texture atlas. -@section GlyphCache-usage Usage +## Usage Create %GlyphCache object with sufficient size and then call @ref AbstractFont::createGlyphCache() to fill it with glyphs. diff --git a/src/Magnum/Text/Renderer.h b/src/Magnum/Text/Renderer.h index f3273bda3..94127c4e6 100644 --- a/src/Magnum/Text/Renderer.h +++ b/src/Magnum/Text/Renderer.h @@ -169,7 +169,7 @@ class MAGNUM_TEXT_EXPORT AbstractRenderer { Lays out the text into mesh using given font. Use of ligatures, kerning etc. depends on features supported by particular font and its layouter. -@section Renderer-usage Usage +## Usage Immutable text (e.g. menu items, credits) can be simply rendered using static methods, returning result either as data arrays or as fully configured mesh. @@ -220,7 +220,7 @@ shader.setTransformationProjectionMatrix(projection*Matrix3::translation(-render renderer.mesh().draw(shader); @endcode -@section Renderer-extensions Required OpenGL functionality +## Required OpenGL functionality Mutable text rendering requires @extension{ARB,map_buffer_range} on desktop OpenGL (also part of OpenGL ES 3.0). If neither @es_extension{EXT,map_buffer_range} diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 9b442ac23..6aa1bdbe8 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -62,7 +62,7 @@ namespace Implementation { Template class for one- to three-dimensional textures. See also @ref AbstractTexture documentation for more information. -@section Texture-usage Usage +## Usage Common usage is to fully configure all texture parameters and then set the data from e.g. @ref Image. Example configuration of high quality texture with diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index 09f6c2eae..37916c8d7 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -53,7 +53,7 @@ namespace Implementation { Template class for one- and two-dimensional texture arrays. See also @ref AbstractTexture documentation for more information. -@section TextureArray-usage Usage +## Usage See @ref Texture documentation for introduction. diff --git a/src/Magnum/TextureTools/DistanceField.h b/src/Magnum/TextureTools/DistanceField.h index afe353e1f..5924d40bc 100644 --- a/src/Magnum/TextureTools/DistanceField.h +++ b/src/Magnum/TextureTools/DistanceField.h @@ -56,6 +56,8 @@ less memory and can be scaled without aliasing issues. Additionally it provides foundation for features like outlining, glow or drop shadow essentially for free. +### The algorithm + For each pixel inside @p rectangle the algorithm looks at corresponding pixel in @p input and tries to find nearest pixel of opposite color in area given by @p radius. Signed distance between the points is then saved as value of given @@ -67,7 +69,7 @@ that the pixel was originally black and nearest white pixel is farther than The resulting texture can be used with bilinear filtering. It can be converted back to binary form in shader using e.g. GLSL `smoothstep()` function with step around `0.5` to create antialiased edges. Or you can exploit the distance field -features to create many other effects. See also Shaders::DistanceFieldVectorShader. +features to create many other effects. See also @ref Shaders::DistanceFieldVector. Based on: *Chris Green - Improved Alpha-Tested Magnification for Vector Textures and Special Effects, SIGGRAPH 2007, diff --git a/src/Magnum/Timeline.h b/src/Magnum/Timeline.h index d86a1dc3b..d37d3490a 100644 --- a/src/Magnum/Timeline.h +++ b/src/Magnum/Timeline.h @@ -42,7 +42,7 @@ namespace Magnum { Keeps track of time delta between frames and allows FPS limiting. Can be used as source for animation speed computations. -@section Timeline-usage Basic usage +## Basic usage Construct the timeline on initialization so the instance is available for whole lifetime of the application. Call @ref start() before first draw event is diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 9d3029461..4c39a6144 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -44,7 +44,7 @@ Provides functionality for converting images between various internal formats or compressing them. See @ref plugins for more information and `*ImageConverter` classes in @ref Trade namespace for available image converter plugins. -@section AbstractImageConverter-subclassing Subclassing +## Subclassing Plugin implements function @ref doFeatures() and one or more of @ref doExportToImage(), @ref doExportToData() or @ref doExportToFile() diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index c847ca88c..90b3b73f4 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -47,7 +47,7 @@ Provides interface for importing 2D/3D scene, mesh, material, texture and image data. See @ref plugins for more information and `*Importer` classes in @ref Trade namespace for available importer plugins. -@section AbstractImporter-subclassing Subclassing +## Subclassing Plugin implements function @ref doFeatures(), @ref doIsOpened(), one of or both @ref doOpenData() and @ref doOpenFile() functions, function @ref doClose() and From 2d6aa06df469350e5bd91a0f39d27bfb6ee8f55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 13:18:22 +0200 Subject: [PATCH 16/18] Improvements in utility help texts. --- src/Magnum/Text/fontconverter.cpp | 2 +- src/Magnum/TextureTools/distancefieldconverter.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 794e3918d..79db061fd 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -65,7 +65,7 @@ FontConverter::FontConverter(const Arguments& arguments): Platform::WindowlessAp .addOption("characters", "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789?!:,. ").setHelp("characters", "characters to include in the output") - .addOption("font-size", "128").setHelpKey("font-size", "N").setHelp("font-size", "TTF font size") + .addOption("font-size", "128").setHelpKey("font-size", "N").setHelp("font-size", "input font size") .addOption("atlas-size", "2048 2048").setHelpKey("atlas-size", "\"X Y\"").setHelp("atlas-size", "glyph atlas size") .addOption("output-size", "256 256").setHelpKey("output-size", "\"X Y\"").setHelp("output-size", "output atlas size. If set to zero size, distance field computation will not be used.") .addOption("radius", "24").setHelpKey("radius", "N").setHelp("radius", "distance field computation radius") diff --git a/src/Magnum/TextureTools/distancefieldconverter.cpp b/src/Magnum/TextureTools/distancefieldconverter.cpp index c46b15a17..1c7d362fd 100644 --- a/src/Magnum/TextureTools/distancefieldconverter.cpp +++ b/src/Magnum/TextureTools/distancefieldconverter.cpp @@ -65,12 +65,12 @@ class DistanceFieldConverter: public Platform::WindowlessApplication { DistanceFieldConverter::DistanceFieldConverter(const Arguments& arguments): Platform::WindowlessApplication(arguments, nullptr) { args.addArgument("input").setHelp("input", "input image") .addArgument("output").setHelp("output", "output image") - .addOption("importer", "TgaImporter").setHelp("image importer plugin") - .addOption("converter", "TgaImageConverter").setHelp("image converter plugin") + .addOption("importer", "TgaImporter").setHelp("importer", "image importer plugin") + .addOption("converter", "TgaImageConverter").setHelp("converter", "image converter plugin") .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelpKey("plugin-dir", "DIR").setHelp("plugin-dir", "base plugin dir") .addNamedArgument("output-size").setHelpKey("output-size", "\"X Y\"").setHelp("output-size", "size of output image") .addNamedArgument("radius").setHelpKey("radius", "N").setHelp("radius", "distance field computation radius") - .setHelp("Converts black&white image to distance-field representation.") + .setHelp("Converts black&white image to distance field representation.") .parse(arguments.argc, arguments.argv); createContext(); From 545ef14071b6aaca5186d81bca8b37f3b54e29b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 13:18:59 +0200 Subject: [PATCH 17/18] doc: documented all command-line utilities. --- doc/utilities.dox | 35 ++++++++++++ src/Magnum/Platform/magnum-info.cpp | 55 +++++++++++++++++++ src/Magnum/Text/AbstractFontConverter.h | 3 + src/Magnum/Text/fontconverter.cpp | 49 ++++++++++++++++- src/Magnum/TextureTools/DistanceField.h | 5 ++ .../TextureTools/distancefieldconverter.cpp | 37 ++++++++++++- 6 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 doc/utilities.dox diff --git a/doc/utilities.dox b/doc/utilities.dox new file mode 100644 index 000000000..dd6cff029 --- /dev/null +++ b/doc/utilities.dox @@ -0,0 +1,35 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +namespace Magnum { +/** @page utilities Utilities +@brief Command-line utilities for system information and data conversion + +- @subpage magnum-info -- @copybrief magnum-info +- @subpage magnum-distancefieldconverter -- @copybrief magnum-distancefieldconverter +- @subpage magnum-fontconverter -- @copybrief magnum-fontconverter + +*/ +} diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index bc24d5ebe..bc7b0b7ef 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -64,6 +64,61 @@ namespace Magnum { +/** @page magnum-info Magnum Info +@brief Displays information about %Magnum engine and OpenGL capabilities + +@section magnum-info-usage Usage + + magnum-info [-h|--help] [--all-extensions] [--limits] + +Arguments: + +- ` -h`, `--help` -- display this help message and exit +- `--all-extensions` -- show extensions also for fully supported versions +- `--limits` -- display also limits and implementation-defined values + +@section magnum-info-example Example output + + +---------------------------------------------------------+ + | Information about Magnum engine and OpenGL capabilities | + +---------------------------------------------------------+ + + Used application: Platform::WindowlessGlxApplication + Compilation flags: + CORRADE_BUILD_DEPRECATED + MAGNUM_BUILD_DEPRECATED + + Vendor: NVIDIA Corporation + Renderer: GeForce GT 740M/PCIe/SSE2 + OpenGL version: OpenGL 4.4 (4.4.0 NVIDIA 337.25) + Context flags: + Supported GLSL versions: + 440 core + 430 core + 420 core + 410 core + 400 core + 330 core + 310 es + 300 es + 100 + + Vendor extension support: + GL_AMD_vertex_shader_layer - + GL_AMD_shader_trinary_minmax - + GL_ARB_robustness SUPPORTED + GL_ATI_texture_mirror_once SUPPORTED + GL_EXT_texture_filter_anisotropic SUPPORTED + GL_EXT_texture_mirror_clamp SUPPORTED + GL_EXT_direct_state_access SUPPORTED + GL_EXT_texture_sRGB_decode SUPPORTED + GL_EXT_shader_integer_mix SUPPORTED + GL_EXT_debug_label - + GL_EXT_debug_marker - + GL_GREMEDY_string_marker - + +*/ + class MagnumInfo: public Platform::WindowlessApplication { public: explicit MagnumInfo(const Arguments& arguments); diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index 7df3c89e4..015ce5038 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -45,6 +45,9 @@ Provides functionality for converting arbitrary font to different format. See @ref plugins for more information and `*FontConverter` classes in @ref Text namespace for available font converter plugins. +You can use the @ref magnum-fontconverter "magnum-fontconverter" utility to do +font conversion on command-line. + ## Subclassing Plugin implements @ref doFeatures() and one or more of `exportTo*()` / diff --git a/src/Magnum/Text/fontconverter.cpp b/src/Magnum/Text/fontconverter.cpp index 79db061fd..ab890dcb7 100644 --- a/src/Magnum/Text/fontconverter.cpp +++ b/src/Magnum/Text/fontconverter.cpp @@ -44,7 +44,50 @@ #include "fontconverterConfigure.h" -namespace Magnum { namespace Text { +namespace Magnum { + +/** +@page magnum-fontconverter Font conversion utility +@brief Converts font to raster one of given atlas size + +@section magnum-fontconverter-usage Usage + + magnum-fontconverter [-h|--help] --font FONT --converter CONVERTER [--plugin-dir DIR] [--characters CHARACTERS] [--font-size N] [--atlas-size "X Y"] [--output-size "X Y"] [--radius N] [--] input output + +Arguments: + +- `input` -- input font +- `output` -- output filename prefix +- `-h`, `--help` -- display help message and exit +- `--font FONT` -- font plugin +- `--converter CONVERTER` -- font converter plugin +- `--plugin-dir DIR` -- base plugin dir (defaults to plugin directory in + %Magnum install location) +- `--characters CHARACTERS` -- characters to include in the output (default: + `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?!:,. `) +- `--font-size N` -- input font size (default: `128`) +- `--atlas-size "X Y"` -- glyph atlas size (default: `"2048 2048"`) +- `--output-size "X Y"` -- output atlas size. If set to zero size, distance + field computation will not be used. (default: `"256 256"`) +- `--radius N` -- distance field computation radius (default: `24`) + +The resulting font files can be then used as specified in the documentation of +`converter` plugin. + +@section magnum-fontconverter-example Example usage + +Making raster font from TTF file with default set of characters using +@ref Text::FreeTypeFont "FreeTypeFont" font plugin and +@ref Text::MagnumFontConverter "MagnumFontConverter" converter plugin: + + magnum-fontconverter --font FreeTypeFont --converter MagnumFontConverter DejaVuSans.ttf myfont + +According to `MagnumFontConverter` plugin documentation, this will generate +files `myfont.conf` and `myfont.tga` in current directory. You can then load +and use them with the @ref Text::MagnumFont "MagnumFont" plugin. +*/ + +namespace Text { class FontConverter: public Platform::WindowlessApplication { public: @@ -130,6 +173,8 @@ int FontConverter::exec() { return 0; } -}} +} + +} MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::Text::FontConverter) diff --git a/src/Magnum/TextureTools/DistanceField.h b/src/Magnum/TextureTools/DistanceField.h index 5924d40bc..342ecb092 100644 --- a/src/Magnum/TextureTools/DistanceField.h +++ b/src/Magnum/TextureTools/DistanceField.h @@ -56,6 +56,11 @@ less memory and can be scaled without aliasing issues. Additionally it provides foundation for features like outlining, glow or drop shadow essentially for free. +You can also use the @ref magnum-distancefieldconverter "magnum-distancefieldconverter" +utility to do distance field conversion on command-line. By extension, this +functionality is also provided through @ref magnum-fontconverter "magnum-fontconverter" +utility. + ### The algorithm For each pixel inside @p rectangle the algorithm looks at corresponding pixel in diff --git a/src/Magnum/TextureTools/distancefieldconverter.cpp b/src/Magnum/TextureTools/distancefieldconverter.cpp index 1c7d362fd..703e2ed3d 100644 --- a/src/Magnum/TextureTools/distancefieldconverter.cpp +++ b/src/Magnum/TextureTools/distancefieldconverter.cpp @@ -50,7 +50,42 @@ #include "distancefieldconverterConfigure.h" -namespace Magnum { namespace TextureTools { +namespace Magnum { + +/** @page magnum-distancefieldconverter Distance Field conversion utility +@brief Converts black&white image to distance field representation + +@section magnum-distancefieldconverter-usage Usage + + magnum-distancefieldconverter [-h|--help] [--importer IMPORTER] [--converter CONVERTER] [--plugin-dir DIR] --output-size "X Y" --radius N [--] input output + +Arguments: + +- `input` -- input image +- `output` -- output image +- `-h`, `--help` -- display help message and exit +- `--importer IMPORTER` -- image importer plugin (default: @ref Trade::TgaImporter "TgaImporter") +- `--converter CONVERTER` -- image converter plugin (default: @ref Trade::TgaImageConverter "TgaImageConverter") +- `--plugin-dir DIR` -- base plugin dir (defaults to plugin directory in + %Magnum install location) +- `--output-size "X Y"` -- size of output image +- `--radius N` -- distance field computation radius + +The resulting image can be then used with @ref Shaders::DistanceFieldVector +shader. See also @ref TextureTools::distanceField() for more information about +the algorithm and parameters. + +@section magnum-distancefield-example Example usage + + magnum-distancefieldconverter --importer PngImporter --output-size "256 256" --radius 24 logo.png logo.tga + +This will open binary `logo.png` image using @ref Trade::PngImporter "PngImporter" +plugin and converts it to 256x256 distance field `logo.tga` using +@ref Trade::TgaImageConverter "TgaImageConverter". + +*/ + +namespace TextureTools { class DistanceFieldConverter: public Platform::WindowlessApplication { public: From 21d3db82dfb8e0c905fa24055e00ca9025411d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Jun 2014 13:23:53 +0200 Subject: [PATCH 18/18] Doc++ --- doc/building.dox | 50 +++++++++++++++++++++-------------------- doc/troubleshooting.dox | 2 +- src/Magnum/Shader.h | 4 +--- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index d1319ce55..ff3a6dfe3 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -167,26 +167,27 @@ CMake and C++ sources, see @ref cmake and @ref Magnum/Magnum.h for more information. See also @ref corrade-cmake and @ref Corrade/Corrade.h for additional information. -By default the engine is built with nearly everything except Audio library, -plugins and application libraries (see below). Using `WITH_*` CMake parameters -you can specify which parts will be built and which not: - -- `WITH_AUDIO` - Audio library. Depends on **OpenAL** library, not built by - default. -- `WITH_DEBUGTOOLS` - DebugTools library. Enables also building of MeshTools, - Primitives, SceneGraph, Shaders and Shapes libraries. -- `WITH_MESHTOOLS` - MeshTools library. Enabled automatically if +By default the engine is built with nearly everything except @ref Audio +library, plugins and application libraries (see below). Using `WITH_*` CMake +parameters you can specify which parts will be built and which not: + +- `WITH_AUDIO` - @ref Audio library. Depends on **OpenAL** library, not built + by default. +- `WITH_DEBUGTOOLS` - @ref DebugTools library. Enables also building of + %MeshTools, %Primitives, %SceneGraph, %Shaders and %Shapes libraries. +- `WITH_MESHTOOLS` - @ref MeshTools library. Enabled automatically if `WITH_DEBUGTOOLS` is enabled. -- `WITH_PRIMITIVES` - Primitives library. Enabled automatically if +- `WITH_PRIMITIVES` - @ref Primitives library. Enabled automatically if `WITH_DEBUGTOOLS` is enabled. -- `WITH_SCENEGRAPH` - SceneGraph library. Enabled automatically if +- `WITH_SCENEGRAPH` - @ref SceneGraph library. Enabled automatically if `WITH_DEBUGTOOLS` or `WITH_SHAPES` is enabled. -- `WITH_SHADERS` - Shaders library. Enabled automatically if `WITH_DEBUGTOOLS` - is enabled. -- `WITH_SHAPES` - Shapes library. Enables also building of SceneGraph +- `WITH_SHADERS` - @ref Shaders library. Enabled automatically if + `WITH_DEBUGTOOLS` is enabled. +- `WITH_SHAPES` - @ref Shapes library. Enables also building of %SceneGraph library. Enabled automatically if `WITH_DEBUGTOOLS` is enabled. -- `WITH_TEXT` - Text library. Enables also building of TextureTools library. -- `WITH_TEXTURETOOLS` - TextureTools library. Enabled automatically if +- `WITH_TEXT` - @ref Text library. Enables also building of %TextureTools + library. +- `WITH_TEXTURETOOLS` - @ref TextureTools library. Enabled automatically if `WITH_TEXT` or `WITH_DISTANCEFIELDCONVERTER` is enabled. None of the @ref Platform "application libraries" is built by default (and you @@ -207,15 +208,16 @@ platform best: There are also a few command-line utilities. They are currently available only on Linux, Mac OS X and Windows, also disabled by default: -- `WITH_MAGNUMINFO` - `magnum-info` executable, provides information about - the engine and OpenGL capabilities. -- `WITH_FONTCONVERTER` - `magnum-fontconverter` executable for converting - fonts to raster ones. Enables also building of Text library. -- `WITH_DISTANCEFIELDCONVERTER` - `magnum-distancefieldconverter` executable - for converting black&white images to distance field textures. Enables also - building of TextureTools library. +- `WITH_MAGNUMINFO` - @ref magnum-info "magnum-info" executable, provides + information about the engine and OpenGL capabilities. +- `WITH_DISTANCEFIELDCONVERTER` - @ref magnum-distancefieldconverter "magnum-distancefieldconverter" + executable for converting black&white images to distance field textures. + Enables also building of %TextureTools library. +- `WITH_FONTCONVERTER` - @ref magnum-fontconverter "magnum-fontconverter" + executable for converting fonts to raster ones. Enables also building of + %Text library. -Magnum also contains a set of dependency-less plugins for importing essential +%Magnum also contains a set of dependency-less plugins for importing essential file formats. Additional plugins are provided in separate plugin repository, see @ref building-plugins for more information. None of the plugins is built by default. diff --git a/doc/troubleshooting.dox b/doc/troubleshooting.dox index f9a096240..08aaeae5f 100644 --- a/doc/troubleshooting.dox +++ b/doc/troubleshooting.dox @@ -55,7 +55,7 @@ try these things: - Check that you use only extensions that are @ref Context::isExtensionSupported() "available on your system". - Check that you didn't exceed any implementation-defined limit (see - `magnum-info` output for list of all of them). + @ref magnum-info output for list of all of them). - Enable @ref DebugMessage "debug output" to see more detailed errors, warnings and performance hints. - If using framebuffer objects, @ref Framebuffer::checkStatus() "check that they are complete". diff --git a/src/Magnum/Shader.h b/src/Magnum/Shader.h index 55525e4e3..1afd37c31 100644 --- a/src/Magnum/Shader.h +++ b/src/Magnum/Shader.h @@ -41,9 +41,7 @@ namespace Magnum { /** @brief %Shader -See @ref AbstractShaderProgram for more information. - -@todoc Usage... +See @ref AbstractShaderProgram for usage information. ## Performance optimizations