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