Browse Source

doc: drop the redundant Magnum prefix from snippet files.

I accidentally did that at first, and then "for consistency" continued
with that for a decade.
pull/638/head
Vladimír Vondruš 2 years ago
parent
commit
2619dc33f1
  1. 2
      doc/debug-tools.dox
  2. 62
      doc/matrix-vector.dox
  3. 4
      doc/method-chaining.dox
  4. 2
      doc/namespaces.dox
  5. 10
      doc/opengl-wrapping.dox
  6. 18
      doc/platform.dox
  7. 4
      doc/platforms-html5.dox
  8. 12
      doc/portability.dox
  9. 28
      doc/scenegraph.dox
  10. 28
      doc/shaders.dox
  11. 0
      doc/snippets/Animation-custom.cpp
  12. 0
      doc/snippets/Animation.cpp
  13. 0
      doc/snippets/Audio-scenegraph.cpp
  14. 0
      doc/snippets/Audio.cpp
  15. 186
      doc/snippets/CMakeLists.txt
  16. 0
      doc/snippets/DebugTools-gl.cpp
  17. 0
      doc/snippets/DebugTools.cpp
  18. 2
      doc/snippets/GL-application.cpp
  19. 0
      doc/snippets/GL.cpp
  20. 0
      doc/snippets/MaterialTools.cpp
  21. 0
      doc/snippets/Math-cpp14.cpp
  22. 0
      doc/snippets/Math-stl.cpp
  23. 0
      doc/snippets/Math.cpp
  24. 0
      doc/snippets/MathAlgorithms.cpp
  25. 0
      doc/snippets/MeshTools-gl.cpp
  26. 0
      doc/snippets/MeshTools-stl.cpp
  27. 0
      doc/snippets/MeshTools.cpp
  28. 0
      doc/snippets/Platform-custom.cpp
  29. 0
      doc/snippets/Platform-portability.cpp
  30. 0
      doc/snippets/Platform-windowless-custom.cpp
  31. 0
      doc/snippets/Platform-windowless-thread.cpp
  32. 0
      doc/snippets/Platform-windowless.cpp
  33. 0
      doc/snippets/Platform.cpp
  34. 0
      doc/snippets/Primitives.cpp
  35. 0
      doc/snippets/SceneGraph-gl.cpp
  36. 0
      doc/snippets/SceneGraph.cpp
  37. 0
      doc/snippets/SceneTools.cpp
  38. 0
      doc/snippets/ShaderTools.cpp
  39. 0
      doc/snippets/Shaders-gl.cpp
  40. 0
      doc/snippets/Text-gl.cpp
  41. 0
      doc/snippets/Text.cpp
  42. 0
      doc/snippets/TextureTools.cpp
  43. 0
      doc/snippets/Trade.cpp
  44. 0
      doc/snippets/Trade.glsl
  45. 0
      doc/snippets/Vk.cpp
  46. 34
      doc/transformations.dox
  47. 14
      doc/types.dox
  48. 16
      doc/vulkan-wrapping.dox
  49. 10
      src/Magnum/Animation/Easing.h
  50. 6
      src/Magnum/Animation/Interpolation.h
  51. 16
      src/Magnum/Animation/Player.h
  52. 8
      src/Magnum/Animation/Track.h
  53. 2
      src/Magnum/Audio/AbstractImporter.h
  54. 4
      src/Magnum/Audio/Context.h
  55. 2
      src/Magnum/Audio/Listener.h
  56. 2
      src/Magnum/Audio/Playable.h
  57. 2
      src/Magnum/DebugTools/ColorMap.h
  58. 14
      src/Magnum/DebugTools/CompareImage.h
  59. 2
      src/Magnum/DebugTools/ForceRenderer.h
  60. 10
      src/Magnum/DebugTools/FrameProfiler.h
  61. 2
      src/Magnum/DebugTools/ObjectRenderer.h
  62. 8
      src/Magnum/DebugTools/TextureImage.h
  63. 4
      src/Magnum/GL/AbstractFramebuffer.h
  64. 30
      src/Magnum/GL/AbstractShaderProgram.h
  65. 16
      src/Magnum/GL/Buffer.h
  66. 12
      src/Magnum/GL/BufferImage.h
  67. 2
      src/Magnum/GL/BufferTexture.h
  68. 14
      src/Magnum/GL/Context.h
  69. 26
      src/Magnum/GL/CubeMapTexture.h
  70. 18
      src/Magnum/GL/CubeMapTextureArray.h
  71. 10
      src/Magnum/GL/DebugOutput.h
  72. 6
      src/Magnum/GL/DefaultFramebuffer.h
  73. 10
      src/Magnum/GL/Framebuffer.h
  74. 30
      src/Magnum/GL/Mesh.h
  75. 2
      src/Magnum/GL/MultisampleTexture.h
  76. 2
      src/Magnum/GL/OpenGLTester.h
  77. 2
      src/Magnum/GL/PrimitiveQuery.h
  78. 18
      src/Magnum/GL/RectangleTexture.h
  79. 4
      src/Magnum/GL/Renderer.h
  80. 4
      src/Magnum/GL/SampleQuery.h
  81. 20
      src/Magnum/GL/Texture.h
  82. 20
      src/Magnum/GL/TextureArray.h
  83. 4
      src/Magnum/GL/TimeQuery.h
  84. 2
      src/Magnum/MaterialTools/RemoveDuplicates.h
  85. 4
      src/Magnum/Math/Algorithms/KahanSum.h
  86. 2
      src/Magnum/Math/Algorithms/Svd.h
  87. 16
      src/Magnum/Math/Angle.h
  88. 6
      src/Magnum/Math/BitVector.h
  89. 46
      src/Magnum/Math/Color.h
  90. 2
      src/Magnum/Math/CubicHermite.h
  91. 2
      src/Magnum/Math/Dual.h
  92. 2
      src/Magnum/Math/Frustum.h
  93. 8
      src/Magnum/Math/Functions.h
  94. 4
      src/Magnum/Math/Half.h
  95. 12
      src/Magnum/Math/Intersection.h
  96. 2
      src/Magnum/Math/Matrix.h
  97. 4
      src/Magnum/Math/Matrix3.h
  98. 4
      src/Magnum/Math/Matrix4.h
  99. 6
      src/Magnum/Math/Packing.h
  100. 4
      src/Magnum/Math/Quaternion.h
  101. Some files were not shown because too many files have changed in this diff Show More

2
doc/debug-tools.dox

@ -59,7 +59,7 @@ given key doesn't exist, default fallback is used.
Example usage: visualizing object position, rotation and scaling using
@ref DebugTools::ObjectRenderer :
@snippet MagnumDebugTools-gl.cpp debug-tools-renderers
@snippet DebugTools-gl.cpp debug-tools-renderers
See @ref DebugTools::ObjectRenderer and @ref DebugTools::ForceRenderer for more
information.

62
doc/matrix-vector.dox

@ -72,30 +72,30 @@ to using the @ref Math::ZeroInit tag. @ref Math::Matrix (and
@ref Math::Matrix3, @ref Math::Matrix4) is by default constructed as an
identity matrix, equivalent to using the @ref Math::IdentityInit tag.
@snippet MagnumMath.cpp matrix-vector-construct
@snippet Math.cpp matrix-vector-construct
The most common and most efficient way to create a vector is to pass all values
to the constructor. A matrix is created by passing all *column* vectors to the
constructor. The constructors check correct number of passed arguments at
compile time.
@snippet MagnumMath.cpp matrix-vector-construct-value
@snippet Math.cpp matrix-vector-construct-value
You can specify all components of a vector or a matrix with a single value, or
specify just values on the matrix diagonal:
@snippet MagnumMath.cpp matrix-vector-construct-diagonal
@snippet Math.cpp matrix-vector-construct-diagonal
There are also shortcuts to create a vector with all but one component set to
zero or one which are useful for transformations:
@snippet MagnumMath.cpp matrix-vector-construct-axis
@snippet Math.cpp matrix-vector-construct-axis
It is also possible to create matrices and vectors from a C-style array. The
function performs a simple type cast without copying anything, so it's possible
to conveniently operate on the array itself:
@snippet MagnumMath.cpp matrix-vector-construct-from
@snippet Math.cpp matrix-vector-construct-from
@attention Note that, unlike a constructor, this function has no way to check
whether the array is long enough to contain all the elements, so use it
@ -106,17 +106,17 @@ richer feature set. Implicit construction of @ref Math::Color4 from just the
RGB components will set the alpha to the max value (thus @cpp 1.0f @ce for
@ref Color4 and @cpp 255 @ce for @ref Color4ub):
@snippet MagnumMath.cpp matrix-vector-construct-color
@snippet Math.cpp matrix-vector-construct-color
Similar to axes and scales in vectors, you can create single color shades too:
@snippet MagnumMath.cpp matrix-vector-construct-color-axis
@snippet Math.cpp matrix-vector-construct-color-axis
There are also builtin colorspace conversion functions --- it's possible to
create a RGB color from a HSV value, a linear color value from a sRGB
representation, or convert from CIE XYZ / xyY. And the other way as well:
@snippet MagnumMath.cpp matrix-vector-construct-color-colorspace
@snippet Math.cpp matrix-vector-construct-color-colorspace
Finally, the namespace @ref Math::Literals provides convenient
@link Literals::operator""_rgb() operator""_rgb() @endlink /
@ -131,29 +131,29 @@ and don't do any gamma correction. For sRGB input, there is
@link Literals::operator""_srgbaf() operator""_srgbaf() @endlink, see their
documentation for more information.
@snippet MagnumMath.cpp matrix-vector-construct-color-literal
@snippet Math.cpp matrix-vector-construct-color-literal
@section matrix-vector-component-access Accessing matrix and vector components
Column vectors of matrices and components of vectors can be accessed using
square brackets:
@snippet MagnumMath.cpp matrix-vector-access
@snippet Math.cpp matrix-vector-access
Row vectors can be accessed too, but only for reading, and access is slower
due to the matrix being stored @ref matrix-vector-column-major "in column-major order":
@snippet MagnumMath.cpp matrix-vector-access-row
@snippet Math.cpp matrix-vector-access-row
Fixed-size vector subclasses have functions for accessing named components
and subparts using either `xyzw` or `rgba`:
@snippet MagnumMath.cpp matrix-vector-access-named
@snippet Math.cpp matrix-vector-access-named
For more involved operations with components there are the @ref Math::gather()
and @ref Math::scatter() functions:
@snippet MagnumMath.cpp matrix-vector-access-swizzle
@snippet Math.cpp matrix-vector-access-swizzle
@section matrix-vector-conversion Converting between different underlying types
@ -169,12 +169,12 @@ To further emphasise the intent of conversion (so it doesn't look like an
accident or a typo), you are encouraged to use @cpp auto b = Type{a} @ce
instead of @cpp Type b{a} @ce.
@snippet MagnumMath.cpp matrix-vector-convert
@snippet Math.cpp matrix-vector-convert
For packing floats into integers and unpacking them back use the
@ref Math::pack() and @ref Math::unpack() functions:
@snippet MagnumMath.cpp matrix-vector-convert-pack
@snippet Math.cpp matrix-vector-convert-pack
See below for more information about other available
@ref matrix-vector-componentwise "component-wise operations".
@ -185,11 +185,11 @@ Vectors can be added, subtracted, negated and multiplied or divided with
scalars, as is common in mathematics. Magnum also adds the ability to divide
a scalar with vector:
@snippet MagnumMath.cpp matrix-vector-operations-vector
@snippet Math.cpp matrix-vector-operations-vector
As in GLSL, vectors can be also multiplied or divided component-wise:
@snippet MagnumMath.cpp matrix-vector-operations-multiply
@snippet Math.cpp matrix-vector-operations-multiply
When working with integral vectors (i.e. 24bit RGB values), it is often
desirable to multiply them with floating-point values but retain an integral
@ -197,20 +197,20 @@ result. In Magnum, all multiplication/division operations involving integral
vectors will return an integer result, you need to convert both arguments to
the same floating-point type to have a floating-point result.
@snippet MagnumMath.cpp matrix-vector-operations-integer
@snippet Math.cpp matrix-vector-operations-integer
You can also use all bitwise operations on integral vectors:
@snippet MagnumMath.cpp matrix-vector-operations-bitwise
@snippet Math.cpp matrix-vector-operations-bitwise
Matrices can be added, subtracted and multiplied with matrix multiplication.
@snippet MagnumMath.cpp matrix-vector-operations-matrix
@snippet Math.cpp matrix-vector-operations-matrix
You can also multiply (properly sized) vectors with matrices. These operations
are equivalent to multiplying with single-column matrices:
@snippet MagnumMath.cpp matrix-vector-operations-multiply-matrix
@snippet Math.cpp matrix-vector-operations-multiply-matrix
@section matrix-vector-componentwise Component-wise and inter-vector operations
@ -219,24 +219,24 @@ As shown above, vectors can be added and multiplied component-wise using the
a vector you can use @ref Math::Vector::sum() "sum()" and
@ref Math::Vector::product() "product()" instead:
@snippet MagnumMath.cpp matrix-vector-operations-componentwise
@snippet Math.cpp matrix-vector-operations-componentwise
Component-wise minimum and maximum of two vectors can be done using
@ref Math::min(), @ref Math::max() or @ref Math::minmax(), similarly with
@ref Vector::min() "min()", @ref Vector::max() "max()" and
@ref Vector2::minmax() "minmax()" for components in one vector.
@snippet MagnumMath.cpp matrix-vector-operations-minmax
@snippet Math.cpp matrix-vector-operations-minmax
The vectors can be also compared component-wise, the result is returned in a
@ref Math::BitVector class:
@snippet MagnumMath.cpp matrix-vector-operations-compare
@snippet Math.cpp matrix-vector-operations-compare
There are also function for component-wise rounding, sign operations, square
root and various interpolation and (de)normalization functionality:
@snippet MagnumMath.cpp matrix-vector-operations-functions
@snippet Math.cpp matrix-vector-operations-functions
Component-wise functions are implemented only for vectors and not for matrices
to keep the math library in a sane and maintainable size. Instead, you can
@ -244,12 +244,12 @@ reinterpret the matrix as a vector and do the operation on it (and vice versa)
--- because you get a reference that way, the operation will affect the
original data:
@snippet MagnumMath.cpp matrix-vector-operations-functions-componentwise
@snippet Math.cpp matrix-vector-operations-functions-componentwise
Note that all component-wise functions in the @ref Math namespace also work for
scalars --- and on the special @ref Deg / @ref Rad types too.
@snippet MagnumMath.cpp matrix-vector-operations-functions-scalar
@snippet Math.cpp matrix-vector-operations-functions-scalar
For types with units the only exception are power functions such as
@ref Math::pow() or @ref Math::log() --- the resulting unit of such an
@ -262,7 +262,7 @@ product, vector, reflection or angle calculation. These are mostly available
as free functions in the @ref Math namespace, with more advanced functionality
such as QR or SVD decomposition in @ref Math::Algorithms.
@snippet MagnumMath.cpp matrix-vector-linear-algebra
@snippet Math.cpp matrix-vector-linear-algebra
@section matrix-vector-column-major Matrices are column-major and vectors are columns
@ -274,18 +274,18 @@ you're used to from linear algebra or other graphics toolkits:
Order of template arguments in specification of @ref Math::RectangularMatrix
is also column-major:
@snippet MagnumMath.cpp matrix-vector-column-major-template
@snippet Math.cpp matrix-vector-column-major-template
</li><li>
Order of components in matrix constructors is also column-major, further
emphasized by the requirement that you must pass column vectors directly:
@snippet MagnumMath.cpp matrix-vector-column-major-construct
@snippet Math.cpp matrix-vector-column-major-construct
</li><li>
Element access order is also column-major, thus the bracket operator
accesses columns. The returned vector also has its own bracket operator,
which then indexes rows.
@snippet MagnumMath.cpp matrix-vector-column-major-access
@snippet Math.cpp matrix-vector-column-major-access
</li><li>
Various algorithms which commonly operate on matrix rows (such as
@ref Algorithms::gaussJordanInPlace() "Gauss-Jordan elimination") have

4
doc/method-chaining.dox

@ -44,7 +44,7 @@ bound somewhere. Method chaining encourages you to configure whole object in
one run, effectively reducing the number of needed bindings. Consider the
following example:
@snippet MagnumGL.cpp method-chaining-texture
@snippet GL.cpp method-chaining-texture
This code is written that similar configuration steps are grouped together,
which might be good when somebody needs to change something for all three
@ -53,7 +53,7 @@ names and after each configuration step the texture must be rebound to another.
With method chaining used the code looks much lighter and each object is
configured in one run, reducing count of bind calls from 9 to 3.
@snippet MagnumGL.cpp method-chaining-texture-chained
@snippet GL.cpp method-chaining-texture-chained
Method chaining is not used on non-configuring functions, such as
@ref GL::Framebuffer::clear() or @ref GL::AbstractShaderProgram::draw(), as

2
doc/namespaces.dox

@ -130,7 +130,7 @@ literals defined by other code, but the second namespace level is
@cpp inline @ce so to get for example the color literals you can do either of
these two:
@snippet MagnumMath.cpp Literals-using
@snippet Math.cpp Literals-using
This library is built as part of Magnum by default. To use this library with
CMake, find the `Magnum` package and link to the `Magnum::Magnum` target:

10
doc/opengl-wrapping.dox

@ -58,7 +58,7 @@ ID of the underlying without releasing it using @cpp id() @ce). It is also
possible to do the opposite --- wrapping an existing OpenGL object ID into a
Magnum object instance using @cpp wrap() @ce:
@snippet MagnumGL.cpp opengl-wrapping-transfer
@snippet GL.cpp opengl-wrapping-transfer
The @cpp wrap() @ce and @cpp release() @ce functions are available for all
OpenGL classes except for @ref GL::AbstractShaderProgram, where the desired
@ -89,7 +89,7 @@ circumvented by constructing the OpenGL objects using the @ref NoCreate tag
first and populating them with live instances once the context is ready. For
example:
@snippet MagnumGL-application.cpp opengl-wrapping-nocreate
@snippet GL-application.cpp opengl-wrapping-nocreate
Please note that objects constructed using the @ref NoCreate tag are equivalent
to the moved-from state, and thus again calling anything on these may result in
@ -112,7 +112,7 @@ tracks OpenGL state such as currently bound objects, activated renderer
features etc. When combining Magnum with third-party code, the internal state
tracker may get confused and you need to reset it using @ref GL::Context::resetState():
@snippet MagnumGL.cpp opengl-wrapping-state
@snippet GL.cpp opengl-wrapping-state
Note that by design it's not possible to reset all state touched by Magnum to
previous values --- it would involve impractically large amount of queries and
@ -138,7 +138,7 @@ GL version/extension is required. The information is also aggregated on
@ref opengl-required-extensions documentation page. Use
@ref GL::Context::isVersionSupported() or @ref GL::Context::isExtensionSupported():
@snippet MagnumGL.cpp opengl-wrapping-extensions
@snippet GL.cpp opengl-wrapping-extensions
@attention Using API that requires OpenGL version or extension that is not
provided by the driver results in undefined behavior --- the best you can
@ -160,7 +160,7 @@ is simply no-op when required extensions are not available,
etc. The goal is to abstract away the (mostly unimportant) differences for
easier porting.
@snippet MagnumGL.cpp opengl-wrapping-dsa
@snippet GL.cpp opengl-wrapping-dsa
*/
}

18
doc/platform.dox

@ -64,7 +64,7 @@ blue color is shown in the following code listing.
`base` branch of [Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap)
repository.
@snippet MagnumPlatform.cpp windowed
@snippet Platform.cpp windowed
@subsection platform-windowed-viewport Responding to viewport size changes
@ -74,7 +74,7 @@ example by resizing the default framebuffer, you need to reimplement
@ref Platform::Sdl2Application::viewportEvent() "viewportEvent()" function and
pass the new size to the framebuffer:
@snippet MagnumPlatform.cpp size
@snippet Platform.cpp size
@section platform-windowless Windowless applications
@ -109,7 +109,7 @@ renderer string and exits is in the following code listing.
is available in `windowless` branch of [Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap)
repository.
@snippet MagnumPlatform-windowless.cpp windowless
@snippet Platform-windowless.cpp windowless
@section platform-compilation Compilation with CMake
@ -141,7 +141,7 @@ window size 800x600 pixels). If you want something else, you can pass
application constructor. Using method chaining it can be done conveniently like
this:
@snippet MagnumPlatform.cpp configuration
@snippet Platform.cpp configuration
@subsection platform-configuration-delayed Delayed context creation
@ -151,7 +151,7 @@ initializer. You can specify @ref NoCreate in the constructor instead and pass
the @relativeref{Platform::Sdl2Application,Configuration} later to a
@relativeref{Platform::Sdl2Application,create()} function:
@snippet MagnumPlatform.cpp createcontext
@snippet Platform.cpp createcontext
If context creation in the constructor or in
@relativeref{Platform::Sdl2Application,create()} fails, the application prints
@ -163,7 +163,7 @@ you abort the launch or retry with different configuration. You can for example
try enabling MSAA first, and if the context creation fails, fall back to no-AA
rendering:
@snippet MagnumPlatform.cpp trycreatecontext
@snippet Platform.cpp trycreatecontext
<b></b>
@ -206,7 +206,7 @@ following code listing.
@note
There's also an example showing @ref examples-triangle-plain-glfw "usage of plain GLFW to render a basic triangle".
@snippet MagnumPlatform-custom.cpp custom
@snippet Platform-custom.cpp custom
@attention The @ref Platform::GLContext instance is bound to a single OpenGL
context, which must be always set as current when calling any Magnum APIs
@ -260,7 +260,7 @@ windowless application header is included.
contexts, but make sure that Magnum is used only with its own OpenGL
context.
@snippet MagnumPlatform-windowless-custom.cpp custom
@snippet Platform-windowless-custom.cpp custom
The main purpose of windowless contexts is threaded OpenGL, used for example
for background data processing. The workflow is to create the windowless
@ -273,6 +273,6 @@ information.
@note Context creation is not thread safe on all platforms, that's why it still
has to be done on the main thread.
@snippet MagnumPlatform-windowless-thread.cpp thread
@snippet Platform-windowless-thread.cpp thread
*/
}

4
doc/platforms-html5.dox

@ -551,12 +551,12 @@ requirement for unique buffer target binding, aligned buffer offset and
stride and some other restrictions. The most prominent difference is that while
the following was enough on desktop:
@snippet MagnumGL.cpp Buffer-webgl-nope
@snippet GL.cpp Buffer-webgl-nope
On WebGL (even 2.0) you always have to initialize the buffers like this (and
other target hints for UBOs etc.):
@snippet MagnumGL.cpp Buffer-webgl
@snippet GL.cpp Buffer-webgl
See @ref GL-Buffer-webgl-restrictions "GL::Buffer",
@ref GL-Mesh-webgl-restrictions "GL::Mesh",

12
doc/portability.dox

@ -48,7 +48,7 @@ If you include @ref Magnum.h, you get these predefined macros:
Example usage:
@snippet MagnumGL.cpp portability-targets
@snippet GL.cpp portability-targets
Each feature is marked accordingly if it is not available in some targets. See
also @ref requires-gl, @ref requires-gles30, @ref requires-gles-only,
@ -79,7 +79,7 @@ thus the decision cannot be made at compile time. Header @ref GL/Extensions.h
contains list of extensions, which you can pass to
@ref GL::Context::isExtensionSupported() and decide based on that:
@snippet MagnumGL.cpp portability-extensions
@snippet GL.cpp portability-extensions
You can also decide on particular OpenGL version using
@ref GL::Context::isVersionSupported(), but remember that some features from
@ -91,7 +91,7 @@ extensions, you can use macros @ref MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED() or
@ref MAGNUM_ASSERT_GL_VERSION_SUPPORTED() to add mandatory requirement of given
extension or version:
@snippet MagnumGL.cpp portability-extension-assert
@snippet GL.cpp portability-extension-assert
Each class, function or enum value is marked accordingly if it needs specific
extension or specific OpenGL version. Various classes in Magnum are taking
@ -115,7 +115,7 @@ you can decide on the syntax in your shader code. You can also use
version from a list:
<p>
@snippet MagnumGL.cpp portability-shaders
@snippet GL.cpp portability-shaders
</p>
@code{.vert}
@ -141,7 +141,7 @@ be available in given GLSL version (e.g. causing compilation errors). You can
use @ref GL::Context::isExtensionSupported(Version) const to check that the
extension is present in given version:
@snippet MagnumGL.cpp portability-shaders-bind
@snippet GL.cpp portability-shaders-bind
See also @ref GL::AbstractShaderProgram class documentation for information
about specifying attribute location, uniform location and texture binding unit
@ -173,7 +173,7 @@ and desktop (using SDL2 toolkit). Thanks to static polymorphism most of the
functions will work on both without changes, the main difference might (or
might not, depending what you use) be in particular event handlers:
@snippet MagnumPlatform-portability.cpp application
@snippet Platform-portability.cpp application
And corresponding CMake code. Note that we need to call @cmake find_package() @ce
twice, first to get the @ref MAGNUM_TARGET_GLES variable and then again to find

28
doc/scenegraph.dox

@ -155,7 +155,7 @@ Common usage of transformation classes is to typedef @ref SceneGraph::Scene and
@ref SceneGraph::Object with desired transformation type to save unnecessary
typing later:
@snippet MagnumSceneGraph.cpp typedef
@snippet SceneGraph.cpp typedef
@attention Note that you have to include both @ref Magnum/SceneGraph/Object.h
and desired transformation class (e.g. @ref Magnum/SceneGraph/MatrixTransformation3D.h)
@ -166,7 +166,7 @@ The object type is subclassed from the transformation type and so the
and @ref SceneGraph::MatrixTransformation3D. For convenience you can use method
chaining:
@snippet MagnumSceneGraph.cpp method-chaining
@snippet SceneGraph.cpp method-chaining
@section scenegraph-hierarchy Scene hierarchy
@ -182,7 +182,7 @@ The scene is always a root object, so it naturally cannot have any parent or
transformation. Parent and children relationships can be observed through
@ref SceneGraph::Object::parent() and @ref SceneGraph::Object::children().
@snippet MagnumSceneGraph.cpp hierarchy
@snippet SceneGraph.cpp hierarchy
This hierarchy also takes care of memory management --- when an object is
destroyed, all its children are destroyed too. See detailed explanation of
@ -191,7 +191,7 @@ below for information about possible issues. To reflect the implicit memory
management in the code better, you can use @ref SceneGraph::Object::addChild()
instead of the naked @cpp new @ce call from the code above:
@snippet MagnumSceneGraph.cpp hierarchy-addChild
@snippet SceneGraph.cpp hierarchy-addChild
@section scenegraph-features Object features
@ -221,7 +221,7 @@ a feature to an object might look just like the following, as in some cases you
don't even need to keep the pointer to it. List of object features is
accessible through @ref SceneGraph::Object::features().
@snippet MagnumSceneGraph.cpp feature
@snippet SceneGraph.cpp feature
Some features are passive, others active. Passive features can just be added to
an object, with no additional work except for possible configuration (for
@ -233,7 +233,7 @@ want and implement functions you need in your own @ref SceneGraph::Object
subclass without having to subclass each feature individually (and making the
code overly verbose). A simplified example:
@snippet MagnumSceneGraph.cpp feature-inherit
@snippet SceneGraph.cpp feature-inherit
From the outside there is no difference between features added "at runtime" and
features added using multiple inheritance, they can be both accessed from the
@ -246,7 +246,7 @@ for information about possible issues. Also, there is the
@ref SceneGraph::AbstractObject::addFeature() "addFeature()" counterpart to
@ref SceneGraph::Object::addChild() "addChild()":
@snippet MagnumSceneGraph.cpp feature-addFeature
@snippet SceneGraph.cpp feature-addFeature
@subsection scenegraph-features-caching Transformation caching in features
@ -275,7 +275,7 @@ to have caching, you must enable it first, because by default caching is
disabled. You can enable it using @ref SceneGraph::AbstractFeature::setCachedTransformations()
and then implement the corresponding cleaning function(s):
@snippet MagnumSceneGraph.cpp caching
@snippet SceneGraph.cpp caching
When you need to use the cached value, you can explicitly request the cleanup
by calling @ref SceneGraph::Object::setClean(). @ref SceneGraph::Camera, for
@ -319,7 +319,7 @@ In the following example we are able to get pointer to both the
@ref SceneGraph::AbstractObject and the needed transformation from a single
constructor parameter using a trick:
@snippet MagnumSceneGraph.cpp transformation
@snippet SceneGraph.cpp transformation
If we take for example @ref SceneGraph::Object "SceneGraph::Object<MatrixTransformation3D>",
it is derived from @ref SceneGraph::AbstractObject "SceneGraph::AbstractObject3D"
@ -341,13 +341,13 @@ parent is destroyed. When creating them on the stack, however, they will be
destroyed when they go out of scope. Normally, the natural order of creation is
not a problem:
@snippet MagnumSceneGraph.cpp construction-order
@snippet SceneGraph.cpp construction-order
The `object` is created last, so it will be destroyed first, removing itself
from `scene`'s children list, causing no problems when destroying the `scene`
object later. However, if their order is swapped, it will cause problems:
@snippet MagnumSceneGraph.cpp construction-order-crash
@snippet SceneGraph.cpp construction-order-crash
The `scene` will be destroyed first, deleting all its children, which is wrong,
because `object` is created on stack. If this doesn't already crash, the
@ -359,7 +359,7 @@ When destroying the object, all its features are destroyed. For features added
as a member it's not an issue, however features added using multiple
inheritance must be inherited after the Object class:
@snippet MagnumSceneGraph.cpp feature-construction-order
@snippet SceneGraph.cpp feature-construction-order
When constructing `MyObject`, `Object3D` constructor is called first and then
`MyFeature` constructor adds itself to `Object3D`'s list of features. When
@ -369,7 +369,7 @@ from `Object3D`'s list, then `Object3D` destructor.
However, if we would inherit `MyFeature` first, it will cause problems:
@snippet MagnumSceneGraph.cpp feature-construction-order-crash
@snippet SceneGraph.cpp feature-construction-order-crash
`MyFeature` tries to add itself to feature list in not-yet-constructed
`Object3D`, causing undefined behavior. Then, if this doesn't already crash,
@ -379,7 +379,7 @@ invisible.
If we would construct them in swapped order (if it is even possible), it
wouldn't help either:
@snippet MagnumSceneGraph.cpp feature-construction-order-crash-destruction
@snippet SceneGraph.cpp feature-construction-order-crash-destruction
On destruction, `Object3D` destructor is called first, deleting `MyFeature`,
which is wrong, because `MyFeature` is in the same object. After that (if the

28
doc/shaders.dox

@ -65,7 +65,7 @@ position in the buffer. See @ref GL::Mesh::addVertexBuffer() for details and
usage examples. Example mesh configuration for the @ref Shaders::PhongGL
shader:
@snippet MagnumShaders-gl.cpp shaders-setup
@snippet Shaders-gl.cpp shaders-setup
Each shader then has its own set of configuration functions. Some configuration
is static, specified commonly as flags in constructor, directly affecting
@ -87,7 +87,7 @@ Example configuration and rendering using @link Shaders::PhongGL @endlink ---
by default it's just colored and uses a single light, and we set a color of
both in addition to transformation, projection and normal matrices:
@snippet MagnumShaders-gl.cpp shaders-classic
@snippet Shaders-gl.cpp shaders-classic
@subsection shaders-usage-ubo Using uniform buffers
@ -117,7 +117,7 @@ then via @ref Shaders::PhongDrawUniform, @ref Shaders::PhongMaterialUniform and
fields directly, the data layout may be non-trivial and it's thus recommended
to use the setters unless they prove to be a performance bottleneck:
@snippet MagnumShaders-gl.cpp shaders-ubo
@snippet Shaders-gl.cpp shaders-ubo
Altogether, this results in the same output as in the classic uniform case
shown above. Similarly to the classic uniforms, default-constructed structures
@ -169,7 +169,7 @@ The following snippet shows drawing three different meshes, where two of them
share the same material definition. The projection and light buffer is the same
as above:
@snippet MagnumShaders-gl.cpp shaders-multi
@snippet Shaders-gl.cpp shaders-multi
While this minimizes the state changes to just a single immediate uniform being
changed between draws, it's possible to go even further by using
@ -185,7 +185,7 @@ which will make it use the @glsl gl_DrawID @ce builtin to pick the per-draw
parameters on its own. The above snippet modified for multidraw would then look
like this, uniform upload and binding is the same as before:
@snippet MagnumShaders-gl.cpp shaders-multidraw
@snippet Shaders-gl.cpp shaders-multidraw
<b></b>
@ -233,7 +233,7 @@ it's just the same sphere drawn three times in different locations and with a
different material applied. Note that the per-instance color is achieved by
using the usual vertex color attribute, only instanced:
@snippet MagnumShaders-gl.cpp shaders-instancing
@snippet Shaders-gl.cpp shaders-instancing
@subsection shaders-usage-skinning Skinning
@ -246,7 +246,7 @@ hierarchy and associated animations. The following snippet shows compiling a
set up shader parameters and finally uploading calculated joint matrices to
perform the skinning animation:
@snippet MagnumShaders-gl.cpp shaders-skinning
@snippet Shaders-gl.cpp shaders-skinning
The above hardcodes the joint counts in the shader, which makes it the most
optimal for rendering given mesh. However, with multiple skinned meshes it'd
@ -257,7 +257,7 @@ for a particular draw upload just a subset of joint matrices the mesh would
reference and set the count of actually used per-vertex joints via
@ref Shaders::PhongGL::setPerVertexJointCount(). Thus, compared to above:
@snippet MagnumShaders-gl.cpp shaders-skinning-dynamic
@snippet Shaders-gl.cpp shaders-skinning-dynamic
@subsection shaders-usage-textures Using textures
@ -268,7 +268,7 @@ shaders are just colored. Enabling a texture is done via a flag (such as
an appropriate `bind*Texture()` call. In most cases the texture value is
multiplied with the corresponding color uniform.
@snippet MagnumShaders-gl.cpp shaders-textures
@snippet Shaders-gl.cpp shaders-textures
All shaders that support textures are also able to apply arbitrary
transformation to the texture coordinate attribute by enabling
@ -312,7 +312,7 @@ and light buffers are the same as before, there's a new per-draw
@ref Shaders::TextureTransformationUniform buffer supplying the layer
information:
@snippet MagnumShaders-gl.cpp shaders-texture-arrays
@snippet Shaders-gl.cpp shaders-texture-arrays
While the primary use case of texture arrays is with uniform buffers and
multidraw, they work in the classic uniform workflow as well --- use
@ -336,7 +336,7 @@ forming temporary @ref Shaders::FlatGL::CompileState "Shaders::*GL::CompileState
instances, then possibly doing other work until it's completed, and finally
constructing final shader instances out of the temporary state:
@snippet MagnumShaders-gl.cpp shaders-async
@snippet Shaders-gl.cpp shaders-async
The above code will work correctly also on drivers that implement async
compilation partially or not at all --- there
@ -355,7 +355,7 @@ Definition of all generic attributes is available in the
@ref Shaders::GenericGL class. Setup of the mesh @ref shaders-usage "shown above"
using generic attributes could then look like this:
@snippet MagnumShaders-gl.cpp shaders-generic
@snippet Shaders-gl.cpp shaders-generic
Note that in this particular case both setups are equivalent, because
@ref Shaders::PhongGL attribute definitions are just aliases to the generic
@ -364,7 +364,7 @@ above, or use for example @ref Shaders::FlatGL3D or even
@ref Shaders::MeshVisualizerGL3D with the same mesh reconfiguration. The unused
attributes will be simply ignored.
@snippet MagnumShaders-gl.cpp shaders-meshvisualizer
@snippet Shaders-gl.cpp shaders-meshvisualizer
The @ref MeshTools::compile() utility configures meshes using generic vertex
attribute definitions to make them usable with any builtin shader.
@ -376,6 +376,6 @@ offer an object ID output as well. A setup equivalent to what's done in Flat
shader's @ref Shaders-FlatGL-object-id but using the generic definitions would
look like this:
@snippet MagnumShaders-gl.cpp shaders-generic-object-id
@snippet Shaders-gl.cpp shaders-generic-object-id
*/
}

0
doc/snippets/MagnumAnimation-custom.cpp → doc/snippets/Animation-custom.cpp

0
doc/snippets/MagnumAnimation.cpp → doc/snippets/Animation.cpp

0
doc/snippets/MagnumAudio-scenegraph.cpp → doc/snippets/Audio-scenegraph.cpp

0
doc/snippets/MagnumAudio.cpp → doc/snippets/Audio.cpp

186
doc/snippets/CMakeLists.txt

@ -38,11 +38,11 @@ set_directory_properties(PROPERTIES
set(snippets_Magnum_SRCS
Magnum.cpp
MagnumAnimation.cpp
MagnumAnimation-custom.cpp
MagnumMath.cpp
MagnumMath-stl.cpp
MagnumMathAlgorithms.cpp)
Animation.cpp
Animation-custom.cpp
Math.cpp
Math-stl.cpp
MathAlgorithms.cpp)
if(CORRADE_TARGET_EMSCRIPTEN)
list(APPEND snippets_Magnum_SRCS platforms-html5.cpp)
endif()
@ -61,7 +61,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERS
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.9") OR
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0") OR
(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
add_library(snippets-Magnum-cpp14 STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumMath-cpp14.cpp)
add_library(snippets-Magnum-cpp14 STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Math-cpp14.cpp)
target_link_libraries(snippets-Magnum-cpp14 PRIVATE Magnum)
set_target_properties(snippets-Magnum-cpp14 PROPERTIES CORRADE_CXX_STANDARD 14)
if(CORRADE_TESTSUITE_TEST_TARGET)
@ -70,102 +70,102 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERS
endif()
if(MAGNUM_WITH_AUDIO)
add_library(snippets-MagnumAudio STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumAudio.cpp)
target_link_libraries(snippets-MagnumAudio PRIVATE MagnumAudio)
add_library(snippets-Audio STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Audio.cpp)
target_link_libraries(snippets-Audio PRIVATE MagnumAudio)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumAudio)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-Audio)
endif()
if(MAGNUM_WITH_SCENEGRAPH)
add_library(snippets-MagnumAudio-scenegraph STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumAudio-scenegraph.cpp)
target_link_libraries(snippets-MagnumAudio-scenegraph PRIVATE
add_library(snippets-Audio-scenegraph STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
Audio-scenegraph.cpp)
target_link_libraries(snippets-Audio-scenegraph PRIVATE
MagnumAudio
MagnumSceneGraph)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumAudio-scenegraph)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-Audio-scenegraph)
endif()
endif()
endif()
if(MAGNUM_WITH_GL)
add_library(snippets-MagnumGL STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumGL.cpp
MagnumMeshTools-gl.cpp
MagnumShaders-gl.cpp
MagnumText-gl.cpp)
target_link_libraries(snippets-MagnumGL PRIVATE MagnumGL)
add_library(snippets-GL STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
GL.cpp
MeshTools-gl.cpp
Shaders-gl.cpp
Text-gl.cpp)
target_link_libraries(snippets-GL PRIVATE MagnumGL)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumGL)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-GL)
endif()
endif()
if(MAGNUM_WITH_MATERIALTOOLS)
add_library(snippets-MagnumMaterialTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumMaterialTools.cpp)
target_link_libraries(snippets-MagnumMaterialTools PRIVATE MagnumMaterialTools)
add_library(snippets-MaterialTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MaterialTools.cpp)
target_link_libraries(snippets-MaterialTools PRIVATE MagnumMaterialTools)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumMaterialTools)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MaterialTools)
endif()
endif()
if(MAGNUM_WITH_MESHTOOLS)
add_library(snippets-MagnumMeshTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumMeshTools.cpp)
target_link_libraries(snippets-MagnumMeshTools PRIVATE MagnumMeshTools)
add_library(snippets-MeshTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MeshTools.cpp)
target_link_libraries(snippets-MeshTools PRIVATE MagnumMeshTools)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumMeshTools)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MeshTools)
endif()
endif()
if(MAGNUM_WITH_SHADERTOOLS)
add_library(snippets-MagnumShaderTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumShaderTools.cpp)
target_link_libraries(snippets-MagnumShaderTools PRIVATE MagnumShaderTools)
add_library(snippets-ShaderTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
ShaderTools.cpp)
target_link_libraries(snippets-ShaderTools PRIVATE MagnumShaderTools)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumShaderTools)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-ShaderTools)
endif()
endif()
if(MAGNUM_WITH_TEXT)
add_library(snippets-MagnumText STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumText.cpp)
target_link_libraries(snippets-MagnumText PRIVATE MagnumText)
add_library(snippets-Text STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
Text.cpp)
target_link_libraries(snippets-Text PRIVATE MagnumText)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumText)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-Text)
endif()
endif()
if(MAGNUM_WITH_TEXTURETOOLS)
add_library(snippets-MagnumTextureTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumTextureTools.cpp)
target_link_libraries(snippets-MagnumTextureTools PRIVATE MagnumTextureTools)
add_library(snippets-TextureTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
TextureTools.cpp)
target_link_libraries(snippets-TextureTools PRIVATE MagnumTextureTools)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumTextureTools)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-TextureTools)
endif()
endif()
if(MAGNUM_WITH_TRADE)
add_library(snippets-MagnumTrade STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
add_library(snippets-Trade STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
plugins.cpp
MagnumTrade.cpp)
target_link_libraries(snippets-MagnumTrade PRIVATE MagnumTrade)
Trade.cpp)
target_link_libraries(snippets-Trade PRIVATE MagnumTrade)
if(MAGNUM_TARGET_GL)
target_link_libraries(snippets-MagnumTrade PRIVATE MagnumGL)
target_link_libraries(snippets-Trade PRIVATE MagnumGL)
endif()
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumTrade)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-Trade)
endif()
endif()
find_package(Corrade COMPONENTS TestSuite)
if(MAGNUM_WITH_DEBUGTOOLS)
add_library(snippets-MagnumDebugTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumDebugTools.cpp)
target_link_libraries(snippets-MagnumDebugTools PRIVATE MagnumDebugTools)
add_library(snippets-DebugTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
DebugTools.cpp)
target_link_libraries(snippets-DebugTools PRIVATE MagnumDebugTools)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumDebugTools)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-DebugTools)
endif()
if(MAGNUM_BUILD_GL_TESTS AND NOT MAGNUM_TARGET_GLES)
@ -200,36 +200,36 @@ if(MAGNUM_WITH_DEBUGTOOLS)
endif()
if(MAGNUM_TARGET_GL)
add_library(snippets-MagnumDebugTools-gl STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumDebugTools-gl.cpp)
target_link_libraries(snippets-MagnumDebugTools-gl PRIVATE MagnumDebugTools)
add_library(snippets-DebugTools-gl STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
DebugTools-gl.cpp)
target_link_libraries(snippets-DebugTools-gl PRIVATE MagnumDebugTools)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumDebugTools-gl)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-DebugTools-gl)
endif()
endif()
endif()
if(MAGNUM_WITH_PRIMITIVES)
add_library(snippets-MagnumPrimitives STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumPrimitives.cpp)
target_link_libraries(snippets-MagnumPrimitives PRIVATE MagnumPrimitives)
add_library(snippets-Primitives STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
Primitives.cpp)
target_link_libraries(snippets-Primitives PRIVATE MagnumPrimitives)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumPrimitives)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-Primitives)
endif()
endif()
if(MAGNUM_WITH_SCENEGRAPH)
add_library(snippets-MagnumSceneGraph STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumSceneGraph.cpp)
target_link_libraries(snippets-MagnumSceneGraph PRIVATE MagnumSceneGraph)
add_library(snippets-SceneGraph STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
SceneGraph.cpp)
target_link_libraries(snippets-SceneGraph PRIVATE MagnumSceneGraph)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumSceneGraph)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-SceneGraph)
endif()
if(MAGNUM_WITH_SDL2APPLICATION AND MAGNUM_WITH_GL AND MAGNUM_WITH_PRIMITIVES AND MAGNUM_WITH_SHADERS AND MAGNUM_WITH_MESHTOOLS)
add_library(snippets-MagnumSceneGraph-gl STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumSceneGraph-gl.cpp)
target_link_libraries(snippets-MagnumSceneGraph-gl PRIVATE
add_library(snippets-SceneGraph-gl STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
SceneGraph-gl.cpp)
target_link_libraries(snippets-SceneGraph-gl PRIVATE
MagnumGL
MagnumMeshTools
MagnumPrimitives
@ -237,25 +237,25 @@ if(MAGNUM_WITH_SCENEGRAPH)
MagnumSdl2Application
MagnumShaders)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumSceneGraph-gl)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-SceneGraph-gl)
endif()
endif()
endif()
if(MAGNUM_WITH_SCENETOOLS)
add_library(snippets-MagnumSceneTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
MagnumSceneTools.cpp)
target_link_libraries(snippets-MagnumSceneTools PRIVATE MagnumSceneTools)
add_library(snippets-SceneTools STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
SceneTools.cpp)
target_link_libraries(snippets-SceneTools PRIVATE MagnumSceneTools)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumSceneTools)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-SceneTools)
endif()
endif()
if(MAGNUM_WITH_VK)
add_library(snippets-MagnumVk STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumVk.cpp)
target_link_libraries(snippets-MagnumVk PRIVATE MagnumVk)
add_library(snippets-Vk STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Vk.cpp)
target_link_libraries(snippets-Vk PRIVATE MagnumVk)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumVk)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-Vk)
endif()
endif()
@ -265,48 +265,48 @@ if(MAGNUM_WITH_SDL2APPLICATION AND MAGNUM_TARGET_GL)
target_link_libraries(getting-started PRIVATE MagnumSdl2Application)
target_link_libraries(getting-started-blue PRIVATE MagnumSdl2Application)
add_library(snippets-MagnumPlatform STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
add_library(snippets-Platform STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET}
Magnum-application.cpp
MagnumPlatform.cpp
MagnumGL-application.cpp)
target_link_libraries(snippets-MagnumPlatform PRIVATE MagnumSdl2Application)
Platform.cpp
GL-application.cpp)
target_link_libraries(snippets-Platform PRIVATE MagnumSdl2Application)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET}
getting-started
getting-started-blue
snippets-MagnumPlatform)
snippets-Platform)
endif()
endif()
if((NOT MAGNUM_TARGET_GLES AND MAGNUM_WITH_SDL2APPLICATION) OR (MAGNUM_TARGET_GLES AND MAGNUM_WITH_XEGLAPPLICATION))
add_library(snippets-MagnumPlatform-portability STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumPlatform-portability.cpp)
add_library(snippets-Platform-portability STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Platform-portability.cpp)
if(MAGNUM_TARGET_GLES)
target_link_libraries(snippets-MagnumPlatform-portability PRIVATE MagnumXEglApplication)
target_link_libraries(snippets-Platform-portability PRIVATE MagnumXEglApplication)
else()
target_link_libraries(snippets-MagnumPlatform-portability PRIVATE MagnumSdl2Application)
target_link_libraries(snippets-Platform-portability PRIVATE MagnumSdl2Application)
endif()
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-MagnumPlatform-portability)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET} snippets-Platform-portability)
endif()
endif()
if(MAGNUM_WITH_WINDOWLESSEGLAPPLICATION)
add_library(snippets-MagnumPlatform-custom STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumPlatform-custom.cpp)
add_library(snippets-MagnumPlatform-windowless STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumPlatform-windowless.cpp)
add_library(snippets-MagnumPlatform-windowless-custom STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumPlatform-windowless-custom.cpp)
add_library(snippets-MagnumPlatform-windowless-thread STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} MagnumPlatform-windowless-thread.cpp)
add_library(snippets-Platform-custom STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Platform-custom.cpp)
add_library(snippets-Platform-windowless STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Platform-windowless.cpp)
add_library(snippets-Platform-windowless-custom STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Platform-windowless-custom.cpp)
add_library(snippets-Platform-windowless-thread STATIC ${EXCLUDE_FROM_ALL_IF_TEST_TARGET} Platform-windowless-thread.cpp)
target_link_libraries(snippets-MagnumPlatform-custom PRIVATE MagnumWindowlessEglApplication)
target_link_libraries(snippets-MagnumPlatform-windowless PRIVATE MagnumWindowlessEglApplication)
target_link_libraries(snippets-MagnumPlatform-windowless-custom PRIVATE MagnumWindowlessEglApplication)
target_link_libraries(snippets-MagnumPlatform-windowless-thread PRIVATE MagnumWindowlessEglApplication)
target_link_libraries(snippets-Platform-custom PRIVATE MagnumWindowlessEglApplication)
target_link_libraries(snippets-Platform-windowless PRIVATE MagnumWindowlessEglApplication)
target_link_libraries(snippets-Platform-windowless-custom PRIVATE MagnumWindowlessEglApplication)
target_link_libraries(snippets-Platform-windowless-thread PRIVATE MagnumWindowlessEglApplication)
if(CORRADE_TESTSUITE_TEST_TARGET)
add_dependencies(${CORRADE_TESTSUITE_TEST_TARGET}
snippets-MagnumPlatform-custom
snippets-MagnumPlatform-windowless
snippets-MagnumPlatform-windowless-custom
snippets-MagnumPlatform-windowless-thread)
snippets-Platform-custom
snippets-Platform-windowless
snippets-Platform-windowless-custom
snippets-Platform-windowless-thread)
endif()
endif()

0
doc/snippets/MagnumDebugTools-gl.cpp → doc/snippets/DebugTools-gl.cpp

0
doc/snippets/MagnumDebugTools.cpp → doc/snippets/DebugTools.cpp

2
doc/snippets/MagnumGL-application.cpp → doc/snippets/GL-application.cpp

@ -36,7 +36,7 @@ using namespace Magnum;
#define DOXYGEN_ELLIPSIS(...) __VA_ARGS__
/* Namespace used to avoid a conflict with MyApplication defined in
MagnumPlatform.cpp where it *has to* be in the root namespace */
Platform.cpp where it *has to* be in the root namespace */
namespace C {
/* [opengl-wrapping-nocreate] */
class MyApplication: public Platform::Application {

0
doc/snippets/MagnumGL.cpp → doc/snippets/GL.cpp

0
doc/snippets/MagnumMaterialTools.cpp → doc/snippets/MaterialTools.cpp

0
doc/snippets/MagnumMath-cpp14.cpp → doc/snippets/Math-cpp14.cpp

0
doc/snippets/MagnumMath-stl.cpp → doc/snippets/Math-stl.cpp

0
doc/snippets/MagnumMath.cpp → doc/snippets/Math.cpp

0
doc/snippets/MagnumMathAlgorithms.cpp → doc/snippets/MathAlgorithms.cpp

0
doc/snippets/MagnumMeshTools-gl.cpp → doc/snippets/MeshTools-gl.cpp

0
doc/snippets/MagnumMeshTools-stl.cpp → doc/snippets/MeshTools-stl.cpp

0
doc/snippets/MagnumMeshTools.cpp → doc/snippets/MeshTools.cpp

0
doc/snippets/MagnumPlatform-custom.cpp → doc/snippets/Platform-custom.cpp

0
doc/snippets/MagnumPlatform-portability.cpp → doc/snippets/Platform-portability.cpp

0
doc/snippets/MagnumPlatform-windowless-custom.cpp → doc/snippets/Platform-windowless-custom.cpp

0
doc/snippets/MagnumPlatform-windowless-thread.cpp → doc/snippets/Platform-windowless-thread.cpp

0
doc/snippets/MagnumPlatform-windowless.cpp → doc/snippets/Platform-windowless.cpp

0
doc/snippets/MagnumPlatform.cpp → doc/snippets/Platform.cpp

0
doc/snippets/MagnumPrimitives.cpp → doc/snippets/Primitives.cpp

0
doc/snippets/MagnumSceneGraph-gl.cpp → doc/snippets/SceneGraph-gl.cpp

0
doc/snippets/MagnumSceneGraph.cpp → doc/snippets/SceneGraph.cpp

0
doc/snippets/MagnumSceneTools.cpp → doc/snippets/SceneTools.cpp

0
doc/snippets/MagnumShaderTools.cpp → doc/snippets/ShaderTools.cpp

0
doc/snippets/MagnumShaders-gl.cpp → doc/snippets/Shaders-gl.cpp

0
doc/snippets/MagnumText-gl.cpp → doc/snippets/Text-gl.cpp

0
doc/snippets/MagnumText.cpp → doc/snippets/Text.cpp

0
doc/snippets/MagnumTextureTools.cpp → doc/snippets/TextureTools.cpp

0
doc/snippets/MagnumTrade.cpp → doc/snippets/Trade.cpp

0
doc/snippets/MagnumTrade.glsl → doc/snippets/Trade.glsl

0
doc/snippets/MagnumVk.cpp → doc/snippets/Vk.cpp

34
doc/transformations.dox

@ -88,7 +88,7 @@ you don't need to worry about them in initialization.
and rotation transformation can be created by calling @ref Matrix3::rotation(),
@ref Complex::rotation() or @ref DualComplex::rotation(), for example:
@snippet MagnumMath.cpp transformations-rotation2D
@snippet Math.cpp transformations-rotation2D
3D rotation is represented by angle and (three-dimensional) axis. The rotation
can be created by calling @ref Matrix4::rotation(), @ref Quaternion::rotation()
@ -99,7 +99,7 @@ Matrix representation has also @ref Matrix4::rotationX(),
@ref Matrix4::rotationY() and @ref Matrix4::rotationZ() which are faster than
using the generic function for rotation around primary axes. Examples:
@snippet MagnumMath.cpp transformations-rotation3D
@snippet Math.cpp transformations-rotation3D
Rotations are always around origin. Rotation about arbitrary point can be done
by applying translation to have the point at origin, performing the rotation and
@ -113,13 +113,13 @@ then translating back. Read below for more information.
@ref Vector2::xAxis() or @ref Vector2::yAxis() to translate only along given
axis. Examples:
@snippet MagnumMath.cpp transformations-translation2D
@snippet Math.cpp transformations-translation2D
3D translation is defined by three-dimensional vector and can be created with
@ref Matrix4::translation() or @ref DualQuaternion::translation(). You can use
@ref Vector3::xAxis() and friends also here. Examples:
@snippet MagnumMath.cpp transformations-translation3D
@snippet Math.cpp transformations-translation3D
@subsection transformations-scaling Scaling and reflection
@ -130,7 +130,7 @@ or their 2D counterparts to scale along one axis and leave the rest unchanged
or call explicit one-parameter vector constructor to scale uniformly on all
axes. Examples:
@snippet MagnumMath.cpp transformations-scaling
@snippet Math.cpp transformations-scaling
Reflections are defined by normal along which to reflect (i.e., two- or
three-dimensional vector of unit length) and they are also represented by
@ -138,7 +138,7 @@ matrices. Reflection is created with @ref Matrix3::reflection() or
@ref Matrix4::reflection(). You can use @ref Vector3::xAxis() and friends also
here. Examples:
@snippet MagnumMath.cpp transformations-reflection
@snippet Math.cpp transformations-reflection
Scaling and reflection is also done relative to origin, you can use method
mentioned above to scale or reflect around arbitrary point.
@ -159,7 +159,7 @@ unit cube, and perspective projection. Perspective projection is created with
aspect ratio and distance to near and far plane of view frustum or by size of
near plane, its distance and distance to far plane. Some examples:
@snippet MagnumMath.cpp transformations-projection
@snippet Math.cpp transformations-projection
@section transformations-composing Composing and inverting transformations
@ -170,7 +170,7 @@ transformation on the right-hand side of multiplication is applied first, the
transformation on the left-hand side is applied second. For example, rotation
followed by translation is done like this:
@snippet MagnumMath.cpp transformations-composing
@snippet Math.cpp transformations-composing
Inverse transformation can be computed using @ref Matrix3::inverted(),
@ref Matrix4::inverted(), @ref Complex::inverted(), @ref Quaternion::inverted(),
@ -192,14 +192,14 @@ using @ref Matrix4::transformVector() and @ref Quaternion::transformVector().
For transformation with normalized quaternion you can use faster alternative
@ref Quaternion::transformVectorNormalized(). Example:
@snippet MagnumMath.cpp transformations-transform2D
@snippet Math.cpp transformations-transform2D
Point transformation involves also translation, in 2D is done with
@ref Matrix3::transformPoint() and @ref DualComplex::transformPoint(), in 3D
with @ref Matrix4::transformPoint() and @ref DualQuaternion::transformPoint().
Also here you can use faster alternative @ref DualQuaternion::transformPointNormalized():
@snippet MagnumMath.cpp transformations-transform3D
@snippet Math.cpp transformations-transform3D
@section transformations-properties Transformation properties and conversion
@ -207,7 +207,7 @@ It is possible to extract some transformation properties from transformation
matrices, particularly translation vector, rotation/scaling part of the matrix
(or pure rotation if the matrix has uniform scaling) and also base vectors:
@snippet MagnumMath.cpp transformations-properties
@snippet Math.cpp transformations-properties
Extracting scaling and rotation from arbitrary transformation matrices is
harder and can be done using @ref Math::Algorithms::svd(). Extracting rotation
@ -217,7 +217,7 @@ complex number or quaternion, see below.
You can also recreate transformation matrix from rotation and translation
parts:
@snippet MagnumMath.cpp transformations-recreate
@snippet Math.cpp transformations-recreate
Complex numbers and quaternions are far better in this regard and they allow
you to extract rotation angle using @ref Complex::angle() or
@ -226,21 +226,21 @@ Their dual versions allow to extract both rotation and translation part using
@ref DualComplex::rotation() const, @ref DualQuaternion::rotation() const,
@ref DualComplex::translation() const and @ref DualQuaternion::translation() const.
@snippet MagnumMath.cpp transformations-properties-complex-quat
@snippet Math.cpp transformations-properties-complex-quat
You can convert Complex and Quaternion to rotation matrix using
@ref Complex::toMatrix() and @ref Quaternion::toMatrix() or their dual version
to rotation and translation matrix using @ref DualComplex::toMatrix() and
@ref DualQuaternion::toMatrix():
@snippet MagnumMath.cpp transformations-properties-complex-quat-to-matrix
@snippet Math.cpp transformations-properties-complex-quat-to-matrix
Conversion the other way around is possible only from rotation matrices using
@ref Complex::fromMatrix() or @ref Quaternion::fromMatrix() and from rotation
and translation matrices using @ref DualComplex::fromMatrix() and
@ref DualQuaternion::fromMatrix():
@snippet MagnumMath.cpp transformations-properties-complex-quat-from-matrix
@snippet Math.cpp transformations-properties-complex-quat-from-matrix
@section transformations-interpolation Transformation interpolation
@ -299,7 +299,7 @@ can be reorthogonalized using @ref Math::Algorithms::gramSchmidtOrthogonalize()
scaling). You can also use @ref Math::Algorithms::svd() to more precisely (but
way more slowly) account for the drift. Example:
@snippet MagnumMath.cpp transformations-normalization-matrix
@snippet Math.cpp transformations-normalization-matrix
For quaternions and complex number this problem can be solved far more easily
using @ref Complex::normalized(), @ref Quaternion::normalized(),
@ -307,7 +307,7 @@ using @ref Complex::normalized(), @ref Quaternion::normalized(),
Transformation quaternions and complex numbers are always of unit length, thus
normalizing them reduces the drift.
@snippet MagnumMath.cpp transformations-normalization-quat
@snippet Math.cpp transformations-normalization-quat
@section transformations-modelview Model/view terminology and Magnum

14
doc/types.dox

@ -121,7 +121,7 @@ For easier entering of (s)RGB colors in hexadecimal format there are
literals in the @ref Math::Literals namespace. See their documentation for more
information about the differences.
@snippet MagnumMath.cpp types-literals-colors
@snippet Math.cpp types-literals-colors
@section types-binary Binary representation
@ -149,7 +149,7 @@ from/to @ref Float and @ref UnsignedShort and you can also use the
@link Math::Literals::HalfLiterals::operator""_h() _h @endlink literal that is
provided in the @ref Math::Literals namespace:
@snippet MagnumMath.cpp types-literals-half
@snippet Math.cpp types-literals-half
Half-precision vector and matrix types such as @ref Vector3h or @ref Matrix3x3h
work similarly --- you can construct them and convert them from/to other types,
@ -175,20 +175,20 @@ or use custom @link Math::Literals::AngleLiterals::operator""_degf() _degf @endl
@link Math::Literals::AngleLiterals::operator""_rad() _rad @endlink literals
that are provided in the @ref Math::Literals namespace:
@snippet MagnumMath.cpp types-literals-angles
@snippet Math.cpp types-literals-angles
They can be implicitly converted to each other, but conversion to different
underlying type is *explicit* to avoid precision loss (or, on the other hand,
unnecessarily high precision) during computations:
@snippet MagnumMath.cpp types-literals-angle-conversion
@snippet Math.cpp types-literals-angle-conversion
These classes are used exclusively in all functions taking and returning angles
--- trigonometry, angle computation, rotating transformation etc. Thanks to
implicit conversion you can seamlessly use either radians or degrees without
any need to care about what input the function expects:
@snippet MagnumMath.cpp types-literals-usage
@snippet Math.cpp types-literals-usage
@section types-time Time types
@ -209,7 +209,7 @@ The time types are similar in spirit to @ref std::chrono type definitions, but
without a dependency on STL. An opt-in conversion is available if you include
@link Magnum/Math/TimeStl.h @endlink.
@snippet MagnumMath-stl.cpp types-time
@snippet Math-stl.cpp types-time
@section types-other Other types
@ -253,7 +253,7 @@ explicit:
Example:
@snippet MagnumMath.cpp types-literals-init
@snippet Math.cpp types-literals-init
@section types-thirdparty-integration Integration with types from the STL and 3rd party APIs

16
doc/vulkan-wrapping.dox

@ -46,7 +46,7 @@ to know anything about the `CreateInfo`-related definitions anymore. Then, for
convenience, each `ThingCreateInfo.h` header is guaranteed to include the
`Thing.h` as well, so if you want both you can do for example just
@snippet MagnumVk.cpp wrapping-include-createinfo
@snippet Vk.cpp wrapping-include-createinfo
<b></b>
@ -54,7 +54,7 @@ convenience, each `ThingCreateInfo.h` header is guaranteed to include the
instead of having to verbosely include both:
@snippet MagnumVk.cpp wrapping-include-both
@snippet Vk.cpp wrapping-include-both
Unless said otherwise in the particular constructor docs, a `Vk::*CreateInfo`
instance has all required fields set to valid values upon construction, with
@ -90,7 +90,7 @@ stores instance- and device-level function pointers locally in each
@ref Vk::Instance and @ref Vk::Device to avoid this overhead --- these are then
accessible through @ref Vk::Instance::operator->() "operator->()" on both:
@snippet MagnumVk.cpp Instance-function-pointers
@snippet Vk.cpp Instance-function-pointers
For convenience and for easier interaction with 3rd party code, such pointers
can be made global by calling @ref Vk::Instance::populateGlobalFunctionPointers()
@ -98,7 +98,7 @@ and @ref Vk::Device::populateGlobalFunctionPointers(), after which you can use
the `vk*` functions as usual. However, all implications coming from these being
tied to a particular instance/device still apply:
@snippet MagnumVk.cpp Instance-global-function-pointers
@snippet Vk.cpp Instance-global-function-pointers
@section vulkan-wrapping-host-allocation Host memory allocation
@ -130,7 +130,7 @@ directly to Vulkan APIs. You can create them from an existing
structure to supply additional parameters not exposed by Magnum. However take
care to not clash with values and pointers already set:
@snippet MagnumVk.cpp wrapping-extending-create-info
@snippet Vk.cpp wrapping-extending-create-info
Similarly to the @ref NoInit constructors, constructing a `Vk::*CreateInfo`
from the underlying Vulkan structure is guaranteed to not allocate as well ---
@ -170,7 +170,7 @@ able to take pointers to existing @ref Vk::LayerProperties and
availability of implicitly enabled layers and extensions. If they're not
passed, the class may (but also might not) create its own instances internally:
@snippet MagnumVk.cpp wrapping-optimizing-properties-instance
@snippet Vk.cpp wrapping-optimizing-properties-instance
For @ref Vk::Device creation, the @ref Vk::DeviceProperties should ideally be
* *moved* all the way to the @ref Vk::Device constructor, at which point it's
@ -179,7 +179,7 @@ If you have @ref Vk::pickDevice(), @ref Vk::DeviceCreateInfo and
@ref Vk::Device constructor all in a single expression, the optimal operation
is done implicitly:
@snippet MagnumVk.cpp wrapping-optimizing-properties-device-single-expression
@snippet Vk.cpp wrapping-optimizing-properties-device-single-expression
However, if you instantiate @ref Vk::DeviceProperties and/or
@ref Vk::DeviceCreateInfo separately, you have to
@ -187,7 +187,7 @@ However, if you instantiate @ref Vk::DeviceProperties and/or
them to achieve the desired effect. An existing @ref Vk::ExtensionProperties
instance can be also passed to @ref Vk::DeviceCreateInfo to allow reuse:
@snippet MagnumVk.cpp wrapping-optimizing-properties-device-move
@snippet Vk.cpp wrapping-optimizing-properties-device-move
@section vulkan-wrapping-naming-differences Important differences in naming

10
src/Magnum/Animation/Easing.h

@ -241,12 +241,12 @@ See @ref building, @ref cmake and @ref animation for more information.
The easing function is meant to be used to modify the interpolation factor, such as:
@snippet MagnumAnimation.cpp Easing-factor
@snippet Animation.cpp Easing-factor
The @ref Animation library also provides the @ref ease() utility that combines
the interpolator together with the easing function:
@snippet MagnumAnimation.cpp Easing-ease
@snippet Animation.cpp Easing-ease
@section Animation-Easing-equations Equations
@ -261,7 +261,7 @@ range and produces a NaN. You may want to ensure the factor stays in bounds,
using either @ref Math::clamp() or the @ref easeClamped() function --- the
following two expressions are equivalent:
@snippet MagnumAnimation.cpp Easing-clamp
@snippet Animation.cpp Easing-clamp
Out-function @f$ f_\text{out} @f$ for a corresponding in-function @f$ f_\text{in} @f$
is defined as the following, the equations in the docs usually just show the
@ -289,7 +289,7 @@ plots it with a thin blue line. The curve is always normalized to go from
@f$ (0, 0)^T @f$ to @f$ (1, 1)^T @f$, apply arbitrary transformation to each
point as needed:
@snippet MagnumAnimation.cpp Easing-bezier-transform
@snippet Animation.cpp Easing-bezier-transform
@section Animation-Easing-references References
@ -343,7 +343,7 @@ template<class T> struct BasicEasing {
* Implementation matching the GLSL @glsl smoothstep() @ce function.
* Combine with @ref Math::lerp() to get the equivalent result:
*
* @snippet MagnumAnimation.cpp Easing-smoothstep
* @snippet Animation.cpp Easing-smoothstep
*
* @htmlinclude easings-smoothstep.svg
*

6
src/Magnum/Animation/Interpolation.h

@ -230,7 +230,7 @@ Useful to create a new function out of one of the interpolators from
@ref transformations-interpolation and an easing function from @ref Easing. For
example, the following two expressions give the same result:
@snippet MagnumAnimation.cpp ease
@snippet Animation.cpp ease
@see @ref unpack(), @ref unpackEase()
*/
@ -256,7 +256,7 @@ Similar to @ref ease(), but for adding an unpacker function to interpolator
inputs instead of modifying the interpolator phase. The following two
expressions give the same result:
@snippet MagnumAnimation.cpp unpack
@snippet Animation.cpp unpack
@see @ref unpackEase()
*/
@ -272,7 +272,7 @@ unpack the interpolator inputs, then modifies the interpolator phase and
finally passes that to the interpolator function. The following two expressions
give the same result:
@snippet MagnumAnimation.cpp unpackEase
@snippet Animation.cpp unpackEase
*/
template<class T, class V, ResultOf<V>(*interpolator)(const V&, const V&, Float), V(*unpacker)(const T&), Float(*easer)(Float)> constexpr auto unpackEase() -> ResultOf<V>(*)(const V&, const V&, Float) {
return [](const V& a, const V& b, Float t) { return interpolator(unpacker(a), unpacker(b), easer(t)); };

16
src/Magnum/Animation/Player.h

@ -96,7 +96,7 @@ be done with interpolation result values. The simplest option is specifying a
destination location when adding the track using @ref add() --- that'll mean
you get a fresh set of animated values at your disposal after every iteration:
@snippet MagnumAnimation.cpp Player-usage
@snippet Animation.cpp Player-usage
The Player stores just @ref TrackView instances, for every @ref Track instance
you have to ensure that it stays alive for the whole lifetime of the player
@ -110,7 +110,7 @@ instead of a reference to a concrete type. Below is an example of animating
@ref SceneGraph::TranslationRotationScalingTransformation3D transformation
implementation:
@snippet MagnumAnimation.cpp Player-usage-callback
@snippet Animation.cpp Player-usage-callback
The @ref addWithCallbackOnChange() variant will fire the callback only if the
interpolated value changes, which is useful for triggering other events. See
@ -181,7 +181,7 @@ the @ref Timeline in particular, it's recommended to never call
See @ref Animation-Player-time-type "below" for more information about using
different time types.
@snippet MagnumAnimation.cpp Player-usage-playback
@snippet Animation.cpp Player-usage-playback
@section Animation-Player-time-type Using custom time/key types
@ -196,7 +196,7 @@ if the tracks *are* long, you can always use a different key type for them as
well. A good choice is @ref std::chrono::nanoseconds as a time type and keeping
track key values as @ref Magnum::Float "Float" seconds:
@snippet MagnumAnimation.cpp Player-usage-chrono
@snippet Animation.cpp Player-usage-chrono
While there's a builtin support for the above, you are free to use any other
type combination --- for that you need to provide a *scaler* function that will
@ -207,7 +207,7 @@ basic arithmetic and comparison operators. In order to reduce header size, the
to include to get all needed template function definitions. See also
@ref compilation-speedup-hpp for more information.
@snippet MagnumAnimation-custom.cpp Player-usage-custom
@snippet Animation-custom.cpp Player-usage-custom
@section Animation-Player-higher-order Higher-order players, animating time
@ -216,7 +216,7 @@ animate player state. That's doable by creating specialized tracks that control
given player via a state change callback. By adding more tracks you can control
multiple players from a central location.
@snippet MagnumAnimation.cpp Player-higher-order
@snippet Animation.cpp Player-higher-order
Besides state, you can also animate @ref setDuration() and @ref setPlayCount(),
but be aware that setting those while the animation is playing might cause
@ -224,7 +224,7 @@ unwanted jumps and abrupt stops. Time is also completely in your control and
you can employ another @ref Player instance to speed it up or slow it down for
a particular animation:
@snippet MagnumAnimation.cpp Player-higher-order-animated-time
@snippet Animation.cpp Player-higher-order-animated-time
@section Animation-Player-explicit-specializations Explicit template specializations
@ -602,7 +602,7 @@ template<class T, class K
* @ref addWithCallbackOnChange() API using this function, using a
* custom callback to add a value to a vector if it changes:
*
* @snippet MagnumAnimation.cpp Player-addRawCallback
* @snippet Animation.cpp Player-addRawCallback
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class V, class R, class Callback> Player<T, K>& addRawCallback(const TrackView<const K, const V, R>& track, void(*callback)(const TrackViewStorage<const K>&, K, std::size_t&, void*, void(*)(), void*), void* destination, void(*userCallback)(), void* userData);

8
src/Magnum/Animation/Track.h

@ -51,7 +51,7 @@ the @ref Player class, but it's possible to use it separately as well.
Animation track is defined by a list of keyframes (time+value pairs),
interpolator function and extrapolation behavior.
@snippet MagnumAnimation.cpp Track-usage
@snippet Animation.cpp Track-usage
@section Animation-Track-interpolators Types and interpolators
@ -80,7 +80,7 @@ The @ref Track and @ref TrackView classes are fully stateless and the
the beginning every time. You can use @ref at(K, std::size_t&) const to
remember last used keyframe index and pass it in the next iteration as a hint:
@snippet MagnumAnimation.cpp Track-performance-hint
@snippet Animation.cpp Track-performance-hint
@subsection Animation-Track-performance-strict Strict interpolation
@ -91,7 +91,7 @@ implicit @ref Extrapolation::Extrapolated behavior and assumes there are always
at least two keyframes, resulting in more compact interpolation code. If your
animation data satisfy the prerequisites, simply use it in place of @ref at():
@snippet MagnumAnimation.cpp Track-performance-strict
@snippet Animation.cpp Track-performance-strict
@subsection Animation-Track-performance-cache Cache-efficient data layout
@ -102,7 +102,7 @@ interleaving the data and passing them using
instead of having data duplicated scattered across disjoint allocations of
@ref Track instances:
@snippet MagnumAnimation.cpp Track-performance-cache
@snippet Animation.cpp Track-performance-cache
@subsection Animation-Track-performance-interpolator Interpolator function choice

2
src/Magnum/Audio/AbstractImporter.h

@ -247,7 +247,7 @@ Same string as returned by
used inside @ref CORRADE_PLUGIN_REGISTER() to avoid having to update the
interface string by hand every time the version gets bumped:
@snippet MagnumAudio.cpp MAGNUM_AUDIO_ABSTRACTIMPORTER_PLUGIN_INTERFACE
@snippet Audio.cpp MAGNUM_AUDIO_ABSTRACTIMPORTER_PLUGIN_INTERFACE
The interface string version gets increased on every ABI break to prevent
silent crashes and memory corruption. Plugins built against the previous

4
src/Magnum/Audio/Context.h

@ -391,7 +391,7 @@ class MAGNUM_AUDIO_EXPORT Context {
* @ref Extensions namespace in the @ref Magnum/Audio/Extensions.h
* header. Example usage:
*
* @snippet MagnumAudio.cpp Context-isExtensionSupported
* @snippet Audio.cpp Context-isExtensionSupported
*
* @see @ref isExtensionSupported(const Extension&) const,
* @ref MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED()
@ -590,7 +590,7 @@ By default, if assertion fails, an message is printed to error output and the
application aborts. If `CORRADE_NO_ASSERT` is defined, this macro does nothing.
Example usage:
@snippet MagnumAudio.cpp MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED
@snippet Audio.cpp MAGNUM_ASSERT_AUDIO_EXTENSION_SUPPORTED
@see @ref Magnum::Audio::Context::isExtensionSupported() "Audio::Context::isExtensionSupported()",
@ref CORRADE_ASSERT(), @ref CORRADE_INTERNAL_ASSERT()

2
src/Magnum/Audio/Listener.h

@ -50,7 +50,7 @@ features, managed in one or more @ref PlayableGroup instances. In order to
reflect transformation changes affecting the scene, you need to call
@ref update() after each change (or simply every frame):
@snippet MagnumAudio-scenegraph.cpp Listener-usage
@snippet Audio-scenegraph.cpp Listener-usage
For two-dimensional scenes simply replace all `3D` with `2D`. See @ref Playable
for more info about how to set up and group audio sources.

2
src/Magnum/Audio/Playable.h

@ -49,7 +49,7 @@ order to reflect transformation changes from the scene in the spatial audio,
the playable should be added to some @ref PlayableGroup, which is periodically
updated from a currently active @ref Listener using @ref Listener::update():
@snippet MagnumAudio-scenegraph.cpp Playable-usage
@snippet Audio-scenegraph.cpp Playable-usage
Note that @ref Source::setPosition(), @ref Source::setDirection() and
@ref Source::setGain() called on @ref source() will be overwritten on next call

2
src/Magnum/DebugTools/ColorMap.h

@ -145,7 +145,7 @@ either clamp or repeat wrapping. For a sRGB workflow don't forget to set the
texture format to sRGB, to ensure the values are interpreted and interpolated
done correctly.
@snippet MagnumDebugTools-gl.cpp ColorMap
@snippet DebugTools-gl.cpp ColorMap
*/
namespace ColorMap {

14
src/Magnum/DebugTools/CompareImage.h

@ -319,14 +319,14 @@ This type is commonly returned from @ref ImageView::pixels() and allows you to
do arbitrary operations on the viewed data --- for example, comparing pixel
data flipped upside down:
@snippet MagnumDebugTools.cpp CompareImage-pixels-flip
@snippet DebugTools.cpp CompareImage-pixels-flip
For a different scenario, imagine you're comparing data read from a framebuffer
to a ground truth image. On many systems, internal framebuffer storage has to
be four-component; however your if your ground truth image is just
three-component you can cast the pixel data to just a three-component type:
@snippet MagnumDebugTools-gl.cpp CompareImage-pixels-rgb
@snippet DebugTools-gl.cpp CompareImage-pixels-rgb
The pixel views are expected to be cast to one of Magnum scalar or vector
types. The format is then autodetected from the passed type. For types that map
@ -376,7 +376,7 @@ class CompareImage {
Similar to @ref CompareImage, but comparing images loaded from files. Example
usage:
@snippet MagnumDebugTools.cpp CompareImageFile
@snippet DebugTools.cpp CompareImageFile
By default, the comparator uses a local instance of
@ref Corrade::PluginManager::Manager to load image files. This might be
@ -384,7 +384,7 @@ problematic if the code being tested also uses a plugin manager instance or if
you need to use a different plugin directory, for example. For such cases it's
possible to supply an external instance:
@snippet MagnumDebugTools.cpp CompareImageFile-manager
@snippet DebugTools.cpp CompareImageFile-manager
The comparator uses the @ref Trade::AnyImageImporter "AnyImageImporter" plugin,
which in turn delegates the import to some importer plugin matching the image
@ -393,7 +393,7 @@ concrete importer plugin(s) need to be available, otherwise the comparison
fails. An alternative way is manually skipping the test if the plugins are not
available:
@snippet MagnumDebugTools.cpp CompareImageFile-skip
@snippet DebugTools.cpp CompareImageFile-skip
See also @ref CompareImageToFile and @ref CompareFileToImage for comparing
in-memory images to image files and vice versa.
@ -492,7 +492,7 @@ A combination of @ref CompareImage and @ref CompareImageFile, which allows to
compare an in-memory image to a image file. See their documentation for more
information. Example usage:
@snippet MagnumDebugTools.cpp CompareImageToFile
@snippet DebugTools.cpp CompareImageToFile
@see @ref CompareFileToImage
*/
@ -564,7 +564,7 @@ A combination of @ref CompareImage and @ref CompareImageFile, which allows to
compare an image file to an in-memory image. See their documentation for more
information. Example usage:
@snippet MagnumDebugTools.cpp CompareFileToImage
@snippet DebugTools.cpp CompareFileToImage
@see @ref CompareImageToFile
*/

2
src/Magnum/DebugTools/ForceRenderer.h

@ -110,7 +110,7 @@ it must be available for the whole lifetime of the renderer. The renderer is
automatically added to object's features so you don't need to keep a reference
to it.
@snippet MagnumDebugTools-gl.cpp ForceRenderer
@snippet DebugTools-gl.cpp ForceRenderer
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL "TARGET_GL" and `MAGNUM_WITH_SCENEGRAPH` enabled

10
src/Magnum/DebugTools/FrameProfiler.h

@ -63,7 +63,7 @@ GPU time.
Measurements are performed by calling @ref beginFrame() and @ref endFrame() at
designated points in the frame:
@snippet MagnumDebugTools.cpp FrameProfiler-usage
@snippet DebugTools.cpp FrameProfiler-usage
In order to have stable profiling results, the application needs to redraw
constantly. However for applications that otherwise redraw only on change it
@ -82,7 +82,7 @@ the output will be colored and refreshing itself in place. Together with the
on-demand profiling, it could look like this, refreshing the output every 10
frames:
@snippet MagnumDebugTools.cpp FrameProfiler-usage-console
@snippet DebugTools.cpp FrameProfiler-usage-console
And here's a sample output on the terminal --- using a fully configured
@link FrameProfilerGL @endlink:
@ -97,7 +97,7 @@ function or to the constructor, together with specifying count of frames for
the moving average. A CPU duration measurements using the @ref std::chrono APIs
over last 50 frames can be done like this:
@snippet MagnumDebugTools.cpp FrameProfiler-setup-immediate
@snippet DebugTools.cpp FrameProfiler-setup-immediate
In the above case, the measurement result is available immediately on frame
end. That's not always the case, and for example GPU queries need a few frames
@ -108,7 +108,7 @@ two frames later. The profiler automatically takes care of choosing one of the
three instances for each measurement via additional `current` / `previous`
parameters passed to each callback:
@snippet MagnumDebugTools-gl.cpp FrameProfiler-setup-delayed
@snippet DebugTools-gl.cpp FrameProfiler-setup-delayed
<b></b>
@ -519,7 +519,7 @@ A @ref FrameProfiler with OpenGL-specific measurements. Instantiate with a
desired subset of measured values and then continue the same way as described
in the @ref DebugTools-FrameProfiler-usage "FrameProfiler usage documentation":
@snippet MagnumDebugTools-gl.cpp FrameProfilerGL-usage
@snippet DebugTools-gl.cpp FrameProfilerGL-usage
If none if @ref Value::GpuDuration, @ref Value::VertexFetchRatio and
@ref Value::PrimitiveClipRatio is not enabled, the class can operate without an

2
src/Magnum/DebugTools/ObjectRenderer.h

@ -82,7 +82,7 @@ Visualizes object position, rotation and scale using colored axes. See
Example code:
@snippet MagnumDebugTools-gl.cpp ObjectRenderer
@snippet DebugTools-gl.cpp ObjectRenderer
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL "TARGET_GL" and `MAGNUM_WITH_SCENEGRAPH` enabled

8
src/Magnum/DebugTools/TextureImage.h

@ -66,7 +66,7 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(GL::Texture2D& texture, Int level,
Convenience alternative to the above, example usage:
@snippet MagnumDebugTools-gl.cpp textureSubImage-2D-rvalue
@snippet DebugTools-gl.cpp textureSubImage-2D-rvalue
@note This function is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL "TARGET_GL" enabled (done by default). See
@ -97,7 +97,7 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(GL::CubeMapTexture& texture, GL::C
Convenience alternative to the above, example usage:
@snippet MagnumDebugTools-gl.cpp textureSubImage-cubemap-rvalue
@snippet DebugTools-gl.cpp textureSubImage-cubemap-rvalue
@note This function is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL "TARGET_GL" enabled (done by default). See
@ -133,7 +133,7 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(GL::Texture2D& texture, Int level,
Convenience alternative to the above, example usage:
@snippet MagnumDebugTools-gl.cpp textureSubImage-2D-rvalue-buffer
@snippet DebugTools-gl.cpp textureSubImage-2D-rvalue-buffer
@note This function is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL "TARGET_GL" enabled (done by default). See
@ -166,7 +166,7 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(GL::CubeMapTexture& texture, GL::C
Convenience alternative to the above, example usage:
@snippet MagnumDebugTools-gl.cpp textureSubImage-cubemap-rvalue-buffer
@snippet DebugTools-gl.cpp textureSubImage-cubemap-rvalue-buffer
@note This function is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL "TARGET_GL" enabled (done by default). See

4
src/Magnum/GL/AbstractFramebuffer.h

@ -413,7 +413,7 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp AbstractFramebuffer-read1
* @snippet GL.cpp AbstractFramebuffer-read1
*/
Image2D read(const Range2Di& rectangle, Image2D&& image);
@ -453,7 +453,7 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp AbstractFramebuffer-read2
* @snippet GL.cpp AbstractFramebuffer-read2
*/
BufferImage2D read(const Range2Di& rectangle, BufferImage2D&& image, BufferUsage usage);
#endif

30
src/Magnum/GL/AbstractShaderProgram.h

@ -80,35 +80,35 @@ functions and properties:
<li> **Attribute definitions** using @ref Attribute typedefs with location and
type for configuring meshes, for example:
@snippet MagnumGL.cpp AbstractShaderProgram-input-attributes
@snippet GL.cpp AbstractShaderProgram-input-attributes
</li>
<li> **Output attribute locations**, if desired, for example:
@snippet MagnumGL.cpp AbstractShaderProgram-output-attributes
@snippet GL.cpp AbstractShaderProgram-output-attributes
</li>
<li> **Constructor**, which loads, compiles and attaches particular shaders and
links the program together, for example:
@snippet MagnumGL.cpp AbstractShaderProgram-constructor
@snippet GL.cpp AbstractShaderProgram-constructor
</li>
<li> **Uniform setting functions**, which will provide public interface for
protected @ref setUniform() functions. For usability purposes you can
implement also method chaining. Example:
@snippet MagnumGL.cpp AbstractShaderProgram-uniforms
@snippet GL.cpp AbstractShaderProgram-uniforms
</li>
<li> **Texture and texture image binding functions** in which you bind the
textures/images to particular texture/image units using
@ref Texture::bind() "*Texture::bind()" /
@ref Texture::bindImage() "*Texture::bindImage()" and similar, for example:
@snippet MagnumGL.cpp AbstractShaderProgram-textures
@snippet GL.cpp AbstractShaderProgram-textures
</li>
<li> **Transform feedback setup function**, if needed, in which you bind
buffers to particular indices using @ref TransformFeedback::attachBuffer()
and similar, possibly with overloads based on desired use cases, e.g.:
@snippet MagnumGL.cpp AbstractShaderProgram-xfb
@snippet GL.cpp AbstractShaderProgram-xfb
</li>
<li>And optionally, **return derived type from relevant draw/dispatch functions**
to make it possible for users to easily chain draw calls; and on the other
@ -120,7 +120,7 @@ functions and properties:
@ref MAGNUM_GL_ABSTRACTSHADERPROGRAM_SUBCLASS_DRAW_IMPLEMENTATION() or
@ref MAGNUM_GL_ABSTRACTSHADERPROGRAM_SUBCLASS_DISPATCH_IMPLEMENTATION():
@snippet MagnumGL.cpp AbstractShaderProgram-subclass-macro
@snippet GL.cpp AbstractShaderProgram-subclass-macro
</ul>
@subsection GL-AbstractShaderProgram-attribute-location Binding attribute and fragment data location
@ -163,7 +163,7 @@ out vec4 color;
out vec3 normal;
@endcode
@snippet MagnumGL.cpp AbstractShaderProgram-binding
@snippet GL.cpp AbstractShaderProgram-binding
@see @ref maxVertexAttributes(), @ref AbstractFramebuffer::maxDrawBuffers()
@requires_gl30 Extension @gl_extension{EXT,gpu_shader4} for using
@ -221,7 +221,7 @@ uniform mat4 transformationMatrix;
uniform mat3 normalMatrix;
@endcode
@snippet MagnumGL.cpp AbstractShaderProgram-uniform-location
@snippet GL.cpp AbstractShaderProgram-uniform-location
@see @ref maxUniformLocations()
@requires_gl43 Extension @gl_extension{ARB,explicit_uniform_location} for
@ -266,7 +266,7 @@ layout(std140) uniform material {
};
@endcode
@snippet MagnumGL.cpp AbstractShaderProgram-uniform-block-binding
@snippet GL.cpp AbstractShaderProgram-uniform-block-binding
@see @ref Buffer::maxUniformBindings()
@requires_gl31 Extension @gl_extension{ARB,uniform_buffer_object}
@ -324,7 +324,7 @@ uniform sampler2D diffuseTexture;
uniform sampler2D specularTexture;
@endcode
@snippet MagnumGL.cpp AbstractShaderProgram-texture-uniforms
@snippet GL.cpp AbstractShaderProgram-texture-uniforms
@see @ref Shader::maxTextureImageUnits(), @ref maxImageUnits()
@requires_gl42 Extension @gl_extension{ARB,shading_language_420pack} for explicit
@ -361,7 +361,7 @@ out block {
out vec3 velocity;
@endcode
@snippet MagnumGL.cpp AbstractShaderProgram-xfb-outputs
@snippet GL.cpp AbstractShaderProgram-xfb-outputs
@see @ref TransformFeedback::maxInterleavedComponents(),
@ref TransformFeedback::maxSeparateAttributes(),
@ -387,7 +387,7 @@ needed (see @ref GL-Framebuffer-usage "Framebuffer documentation" for more
information). In each draw event set all required shader parameters, bind
specific framebuffer (if needed) and then call @ref draw(). Example:
@snippet MagnumGL.cpp AbstractShaderProgram-rendering
@snippet GL.cpp AbstractShaderProgram-rendering
@section GL-AbstractShaderProgram-compute-workflow Compute workflow
@ -497,14 +497,14 @@ creation capability while keeping also the simple constructor is the following:
5. The original @cpp MyShader() @ce constructor now only passes the result of
@cpp compile() @ce to @cpp MyShader(CompileState&&) @ce.
@snippet MagnumGL.cpp AbstractShaderProgram-async
@snippet GL.cpp AbstractShaderProgram-async
Usage-wise, it can look for example like below, with the last line waiting for
linking to finish and making the shader ready to use. On drivers that don't
perform any async compilation this will behave the same as if the construction
was done the usual way.
@snippet MagnumGL.cpp AbstractShaderProgram-async-usage
@snippet GL.cpp AbstractShaderProgram-async-usage
@section GL-AbstractShaderProgram-performance-optimization Performance optimizations

16
src/Magnum/GL/Buffer.h

@ -164,14 +164,14 @@ implicitly convertible from statically sized C arrays or can be constructed
from a pair of a pointer and a size. You can optionally specify a usage hint
in the second argument, which defaults to @ref BufferUsage::StaticDraw.
@snippet MagnumGL.cpp Buffer-setdata
@snippet GL.cpp Buffer-setdata
Furthermore, if you @cpp #include @ce @ref Corrade/Containers/ArrayViewStl.h,
you can also directly pass STL types such as a @ref std::vector or a
@ref std::array; with @ref Corrade/Containers/ArrayViewStlSpan.h the
@ref std::span is convertible to it as well:
@snippet MagnumGL.cpp Buffer-setdata-stl
@snippet GL.cpp Buffer-setdata-stl
An alternative to @ref setData() that provides more flexibility and better
performance guarantees is @ref setStorage(). It's similar in spirit to texture
@ -181,27 +181,27 @@ textures. The minimal variant of the call shown below creates an immutable
buffer from given data in device memory, in the second argument you can specify
@ref StorageFlags that make it CPU-accessible, (persistently) mappable etc.
@snippet MagnumGL.cpp Buffer-setstorage
@snippet GL.cpp Buffer-setstorage
@section GL-Buffer-data-mapping Memory mapping
Buffer data can be also updated asynchronously. First you need to allocate
the buffer to desired size by passing @cpp nullptr @ce to @ref setData(), e.g.:
@snippet MagnumGL.cpp Buffer-setdata-allocate
@snippet GL.cpp Buffer-setdata-allocate
Then you can map the buffer to client memory and operate with the memory
directly. After you are done with the operation, call @ref unmap() to unmap the
buffer again. The @ref map() functions return a view on a @cpp char @ce array
and you may want to cast it to some useful type first using @ref Containers::arrayCast():
@snippet MagnumGL.cpp Buffer-map
@snippet GL.cpp Buffer-map
If you are updating only a few discrete portions of the buffer, you can use
@ref MapFlag::FlushExplicit and @ref flushMappedRange() to reduce number of
memory operations performed by OpenGL on unmapping. Example:
@snippet MagnumGL.cpp Buffer-flush
@snippet GL.cpp Buffer-flush
@section GL-Buffer-webgl-restrictions WebGL restrictions
@ -212,13 +212,13 @@ default uses any sufficient target when binding the buffer internally (e.g. for
setting data). Which means the following, while completely fine on desktop and
OpenGL ES, is not sufficient on WebGL:
@snippet MagnumGL.cpp Buffer-webgl-nope
@snippet GL.cpp Buffer-webgl-nope
To avoid GL errors, you have to set target hint to desired target, either in
the constructor or using @ref setTargetHint(). A similar care needs to be taken
for uniform buffers and other types of buffers.
@snippet MagnumGL.cpp Buffer-webgl
@snippet GL.cpp Buffer-webgl
To simplify debugging, the @ref Mesh class checks proper target hint when
adding vertex and index buffers under WebGL.

12
src/Magnum/GL/BufferImage.h

@ -56,7 +56,7 @@ corresponding image size and pixel format properties. Because this is a
GL-centric class, it's common to specify the format using @ref GL::PixelFormat
and @link GL::PixelType @endlink:
@snippet MagnumGL.cpp BufferImage-usage
@snippet GL.cpp BufferImage-usage
It's also possible to pass the generic @ref Magnum::PixelFormat to it, however
the @ref format() and @ref type() queries will always return the GL-specific
@ -71,13 +71,13 @@ it, for example to use buffer storage and other advanced functionality. The
image will take an ownership of the buffer, you can use @ref Buffer::wrap() to
make a non-owning copy.
@snippet MagnumGL.cpp BufferImage-usage-wrap
@snippet GL.cpp BufferImage-usage-wrap
It's also possible to create just an image placeholder, storing only the image
properties without data or size. That is useful for example to specify desired
format of image queries in graphics APIs:
@snippet MagnumGL.cpp BufferImage-usage-query
@snippet GL.cpp BufferImage-usage-query
Similarly to @ref ImageView, this class supports extra storage parameters.
See @ref ImageView-usage for more information.
@ -404,7 +404,7 @@ corresponding image size and compression format properties. Because this is a
GL-centric class, it's common to specify the format using
@link GL::CompressedPixelFormat @endlink:
@snippet MagnumGL.cpp CompressedBufferImage-usage
@snippet GL.cpp CompressedBufferImage-usage
It's also possible to pass the generic @ref Magnum::CompressedPixelFormat to
it, however the @ref format() query will always return the GL-specific value.
@ -414,13 +414,13 @@ it, for example to use buffer storage and other advanced functionality. The
image will take an ownership of the buffer, you can use @ref Buffer::wrap() to
make a non-owning copy.
@snippet MagnumGL.cpp CompressedBufferImage-usage-wrap
@snippet GL.cpp CompressedBufferImage-usage-wrap
It's also possible to create just an image placeholder, storing only the image
properties without data or size. That is useful for example to specify desired
format of image queries in graphics APIs:
@snippet MagnumGL.cpp CompressedBufferImage-usage-query
@snippet GL.cpp CompressedBufferImage-usage-query
Similarly to @ref CompressedImageView, this class supports extra storage
parameters. See @ref CompressedImageView-usage for more information.

2
src/Magnum/GL/BufferTexture.h

@ -55,7 +55,7 @@ for more textures or store more than one data in it.
Example usage:
@snippet MagnumGL.cpp BufferTexture-usage
@snippet GL.cpp BufferTexture-usage
In shader, the texture is used via @glsl samplerBuffer @ce,
@glsl isamplerBuffer @ce or @glsl usamplerBuffer @ce. Unlike in classic

14
src/Magnum/GL/Context.h

@ -211,12 +211,12 @@ instances for other OpenGL contexts, *first* you need to "unset" the current one
with @ref makeCurrent() and *then* create another instance, which will then
become implicitly active:
@snippet MagnumGL-application.cpp Context-makeCurrent-nullptr
@snippet GL-application.cpp Context-makeCurrent-nullptr
Once all needed instances are created, switch between them right after making
the underlying GL context current:
@snippet MagnumGL-application.cpp Context-makeCurrent
@snippet GL-application.cpp Context-makeCurrent
@section GL-Context-multithreading Thread safety
@ -734,7 +734,7 @@ class MAGNUM_GL_EXPORT Context {
* equivalent to subsequent @ref isVersionSupported() calls --- the two
* following examples produce the same result:
*
* @snippet MagnumGL.cpp Context-supportedVersion
* @snippet GL.cpp Context-supportedVersion
*
* If no version from the list is supported, returns lowest available
* OpenGL version (@ref Version::GL210 for desktop OpenGL,
@ -751,7 +751,7 @@ class MAGNUM_GL_EXPORT Context {
* and in the @ref opengl-support "OpenGL support tables". Example
* usage:
*
* @snippet MagnumGL.cpp Context-isExtensionSupported
* @snippet GL.cpp Context-isExtensionSupported
*
* @see @ref isExtensionSupported(const Extension&) const,
* @ref MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED(),
@ -769,7 +769,7 @@ class MAGNUM_GL_EXPORT Context {
* @p version. Useful mainly in shader compilation when the decisions
* depend on selected GLSL version, for example:
*
* @snippet MagnumGL.cpp Context-isExtensionSupported-version
* @snippet GL.cpp Context-isExtensionSupported-version
*/
template<class E> bool isExtensionSupported(Version version) const {
static_assert(Implementation::IsExtension<E>::value, "expected an OpenGL extension");
@ -1184,7 +1184,7 @@ By default, if assertion fails, an message is printed to error output and the
application aborts. If `CORRADE_NO_ASSERT` is defined, this macro does nothing.
Example usage:
@snippet MagnumGL.cpp Context-MAGNUM_ASSERT_GL_VERSION_SUPPORTED
@snippet GL.cpp Context-MAGNUM_ASSERT_GL_VERSION_SUPPORTED
@see @ref Magnum::GL::Context::isVersionSupported() "GL::Context::isVersionSupported()",
@ref MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED(), @ref CORRADE_ASSERT(),
@ -1213,7 +1213,7 @@ By default, if assertion fails, an message is printed to error output and the
application aborts. If `CORRADE_NO_ASSERT` is defined, this macro does nothing.
Example usage:
@snippet MagnumGL.cpp Context-MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED
@snippet GL.cpp Context-MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED
@see @ref Magnum::GL::Context::isExtensionSupported() "Context::isExtensionSupported()",
@ref MAGNUM_ASSERT_GL_VERSION_SUPPORTED(), @ref CORRADE_ASSERT(),

26
src/Magnum/GL/CubeMapTexture.h

@ -78,7 +78,7 @@ See @ref Texture documentation for introduction.
Common usage is to fully configure all texture parameters and then set the
data from e.g. set of Image objects:
@snippet MagnumGL.cpp CubeMapTexture-usage
@snippet GL.cpp CubeMapTexture-usage
In shader, the texture is used via @glsl samplerCube @ce, @glsl samplerCubeShadow @ce,
@glsl isamplerCube @ce or @glsl usamplerCube @ce. Unlike in classic textures,
@ -623,7 +623,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-image1
* @snippet GL.cpp CubeMapTexture-image1
*/
Image3D image(Int level, Image3D&& image);
@ -655,7 +655,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-image2
* @snippet GL.cpp CubeMapTexture-image2
*/
BufferImage3D image(Int level, BufferImage3D&& image, BufferUsage usage);
@ -687,7 +687,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-compressedImage1
* @snippet GL.cpp CubeMapTexture-compressedImage1
*/
CompressedImage3D compressedImage(Int level, CompressedImage3D&& image);
@ -722,7 +722,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-compressedImage2
* @snippet GL.cpp CubeMapTexture-compressedImage2
*/
CompressedBufferImage3D compressedImage(Int level, CompressedBufferImage3D&& image, BufferUsage usage);
@ -761,7 +761,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-image3
* @snippet GL.cpp CubeMapTexture-image3
*/
Image2D image(CubeMapCoordinate coordinate, Int level, Image2D&& image);
@ -794,7 +794,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-image4
* @snippet GL.cpp CubeMapTexture-image4
*/
BufferImage2D image(CubeMapCoordinate coordinate, Int level, BufferImage2D&& image, BufferUsage usage);
@ -836,7 +836,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-compressedImage3
* @snippet GL.cpp CubeMapTexture-compressedImage3
*/
CompressedImage2D compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D&& image);
@ -873,7 +873,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-compressedImage4
* @snippet GL.cpp CubeMapTexture-compressedImage4
*/
CompressedBufferImage2D compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image, BufferUsage usage);
@ -902,7 +902,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-subImage1
* @snippet GL.cpp CubeMapTexture-subImage1
*/
Image3D subImage(Int level, const Range3Di& range, Image3D&& image);
@ -939,7 +939,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-subImage2
* @snippet GL.cpp CubeMapTexture-subImage2
*/
BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage);
@ -969,7 +969,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-compressedSubImage1
* @snippet GL.cpp CubeMapTexture-compressedSubImage1
*/
CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image);
@ -1008,7 +1008,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTexture-compressedSubImage2
* @snippet GL.cpp CubeMapTexture-compressedSubImage2
*/
CompressedBufferImage3D compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage);
#endif

18
src/Magnum/GL/CubeMapTextureArray.h

@ -58,7 +58,7 @@ You have to allocate the memory for all layers and faces first by calling
@ref setStorage(). Example: array with 4 layers of cube maps, each cube map
consisting of six 64x64 images, i.e. 24 layers total:
@snippet MagnumGL.cpp CubeMapTextureArray-usage
@snippet GL.cpp CubeMapTextureArray-usage
In shader, the texture is used via @glsl samplerCubeArray @ce,
@glsl samplerCubeArrayShadow @ce, @glsl isamplerCubeArray @ce or
@ -531,7 +531,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-image1
* @snippet GL.cpp CubeMapTextureArray-image1
*/
Image3D image(Int level, Image3D&& image);
@ -567,7 +567,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-image2
* @snippet GL.cpp CubeMapTextureArray-image2
*/
BufferImage3D image(Int level, BufferImage3D&& image, BufferUsage usage);
@ -593,7 +593,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-compressedImage1
* @snippet GL.cpp CubeMapTextureArray-compressedImage1
*/
CompressedImage3D compressedImage(Int level, CompressedImage3D&& image);
@ -632,7 +632,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-compressedImage2
* @snippet GL.cpp CubeMapTextureArray-compressedImage2
*/
CompressedBufferImage3D compressedImage(Int level, CompressedBufferImage3D&& image, BufferUsage usage);
@ -661,7 +661,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-subImage1
* @snippet GL.cpp CubeMapTextureArray-subImage1
*/
Image3D subImage(Int level, const Range3Di& range, Image3D&& image);
@ -698,7 +698,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-subImage2
* @snippet GL.cpp CubeMapTextureArray-subImage2
*/
BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage);
@ -733,7 +733,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-compressedSubImage1
* @snippet GL.cpp CubeMapTextureArray-compressedSubImage1
*/
CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image);
@ -776,7 +776,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp CubeMapTextureArray-compressedSubImage2
* @snippet GL.cpp CubeMapTextureArray-compressedSubImage2
*/
CompressedBufferImage3D compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage);
#endif

10
src/Magnum/GL/DebugOutput.h

@ -93,7 +93,7 @@ application itself by setting up message callback using @ref setCallback() or
is passed for context creation, both with windowed and windowless
application implementations.
@snippet MagnumGL.cpp DebugOutput-usage
@snippet GL.cpp DebugOutput-usage
With default callback the group entering/leaving and the inserted message (and
possibly also other messages) will be printed on standard output:
@ -424,7 +424,7 @@ class MAGNUM_GL_EXPORT DebugOutput {
* to @ref Corrade::Utility::Debug "Debug" output in the following
* format:
*
* @snippet MagnumGL.cpp DebugOutput-setDefaultCallback
* @snippet GL.cpp DebugOutput-setDefaultCallback
*
* @code{.shell-session}
* Debug output: application marker (1337): Hello from OpenGL command stream!
@ -480,7 +480,7 @@ available and default debug output callback is enabled for given kind of
messages, the inserted message will be printed on standard output in the
following form:
@snippet MagnumGL.cpp DebugMessage-usage
@snippet GL.cpp DebugMessage-usage
<p>
@code{.shell-session}
@ -648,12 +648,12 @@ See @ref DebugOutput for introduction.
Easiest way is to push debug group by creating instance and pop it
automatically at the end of scope:
@snippet MagnumGL.cpp DebugGroup-usage1
@snippet GL.cpp DebugGroup-usage1
If, for some reason, you need to pop in different scope, you can call @ref push()
and @ref pop() manually:
@snippet MagnumGL.cpp DebugGroup-usage2
@snippet GL.cpp DebugGroup-usage2
If OpenGL 4.3 / OpenGL ES 3.2 is supported or @gl_extension{KHR,debug} desktop or
ES extension (covered also by @gl_extension{ANDROID,extension_pack_es31a}) is

6
src/Magnum/GL/DefaultFramebuffer.h

@ -54,7 +54,7 @@ classes, pass the new size in your
@ref Platform::Sdl2Application::viewportEvent() "viewportEvent()"
implementation, for example:
@snippet MagnumGL-application.cpp DefaultFramebuffer-usage-viewport
@snippet GL-application.cpp DefaultFramebuffer-usage-viewport
Next thing you probably want is to clear all used buffers before performing
any drawing. Again, in case you're using one of the
@ -62,7 +62,7 @@ any drawing. Again, in case you're using one of the
@ref Platform::Sdl2Application::drawEvent() "drawEvent()" implementation, for
example:
@snippet MagnumGL-application.cpp DefaultFramebuffer-usage-clear
@snippet GL-application.cpp DefaultFramebuffer-usage-clear
See documentation of particular functions and @ref Framebuffer documentation
for more involved usage, usage of non-default or multiple framebuffers.
@ -378,7 +378,7 @@ class MAGNUM_GL_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* can achieve the same by passing @ref DrawAttachment::None as
* attachment. Example usage:
*
* @snippet MagnumGL.cpp DefaultFramebuffer-usage-map
* @snippet GL.cpp DefaultFramebuffer-usage-map
*
* If @gl_extension{ARB,direct_state_access} (part of OpenGL 4.5) is
* not available, the framebuffer is bound before the operation (if not

10
src/Magnum/GL/Framebuffer.h

@ -67,12 +67,12 @@ there's not much reason to use @ref Renderbuffer anymore, however in OpenGL ES
and WebGL due to various texture format restrictions, renderbuffers are still
the more flexible option if you don't need to use the result in a shader.
@snippet MagnumGL.cpp Framebuffer-usage
@snippet GL.cpp Framebuffer-usage
Rendering then usually consists of switching between different framebuffers
using @ref bind() and reusing the rendered texture in subsequent draws:
@snippet MagnumGL.cpp Framebuffer-usage-rendering
@snippet GL.cpp Framebuffer-usage-rendering
@section GL-Framebuffer-usage-multisample Multisampled rendering
@ -80,7 +80,7 @@ Another use case for custom framebuffers is multisampled rendering --- as
you're not always allowed to control the MSAA setting on a default framebuffer,
or you might want your rendered texture to be multisampled as well:
@snippet MagnumGL.cpp Framebuffer-usage-multisample
@snippet GL.cpp Framebuffer-usage-multisample
Here @ref Renderbuffer gets used for the color attachment as well. While it's
possible to achieve the same with a @ref MultisampleTexture2D, support for it
@ -95,7 +95,7 @@ gets used. In builtin shaders this is also how the
@ref Shaders::FlatGL::ColorOutput / @ref Shaders::FlatGL::ObjectIdOutput etc.
get used:
@snippet MagnumGL.cpp Framebuffer-usage-deferred
@snippet GL.cpp Framebuffer-usage-deferred
@section GL-Framebuffer-performance-optimizations Performance optimizations
@ -535,7 +535,7 @@ class MAGNUM_GL_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractO
* used, you can achieve the same by passing @ref Framebuffer::DrawAttachment::None
* as color attachment ID. Example usage:
*
* @snippet MagnumGL.cpp Framebuffer-mapForDraw
* @snippet GL.cpp Framebuffer-mapForDraw
*
* If @gl_extension{ARB,direct_state_access} (part of OpenGL 4.5) is
* not available, the framebuffer is bound before the operation (if not

30
src/Magnum/GL/Mesh.h

@ -251,7 +251,7 @@ If you have a @ref Trade::MeshData instance that you got for example from
@ref Trade::AbstractImporter::mesh() or from the @ref Primitives library, the
simplest possible way is to use @ref MeshTools::compile():
@snippet MagnumTrade.cpp MeshData-usage-compile
@snippet Trade.cpp MeshData-usage-compile
This one-liner uploads the data and configures the mesh for all attributes
known by Magnum that are present in it, making it suitable to be drawn by
@ -286,7 +286,7 @@ type expected by @ref Shaders::FlatGL3D::Position, so the default constructor
is sufficient for it. The @ref GL-Mesh-configuration-formats section below
shows cases where the types don't match.
@snippet MagnumGL.cpp Mesh-vertices
@snippet GL.cpp Mesh-vertices
Here's a mesh with a position and a normal interleaved together, as is needed
for @ref Shaders::PhongGL. See the docs of @ref addVertexBuffer() for
@ -296,12 +296,12 @@ specified. Note that @ref Shaders::FlatGL::Position and
@ref Shaders::GenericGL::Position, meaning you can render a mesh configured for
the Phong shader with the Flat shader as well:
@snippet MagnumGL.cpp Mesh-vertices-interleaved
@snippet GL.cpp Mesh-vertices-interleaved
Indexed meshes have the index buffer and corresponding index type set using
@ref setIndexBuffer().
@snippet MagnumGL.cpp Mesh-indices
@snippet GL.cpp Mesh-indices
<b></b>
@ -331,13 +331,13 @@ use @ref MeshTools::interleave() to interleave them together. The usage
including the padding specification, is similar to @ref addVertexBuffer(). The
above vertex buffer setup but with separate position and normal arrays that get interleaved can be expressed like this:
@snippet MagnumGL.cpp Mesh-vertices-interleaved-tool
@snippet GL.cpp Mesh-vertices-interleaved-tool
For indices it's often beneficial to store them in a 16-bit type if they don't
need the full 32-bit range. That's what @ref MeshTools::compressIndices() is
for:
@snippet MagnumGL.cpp Mesh-indices-tool
@snippet GL.cpp Mesh-indices-tool
The ultimate generic tool is the already-shown @ref MeshTools::compile(),
together with all @ref MeshTools APIs that operate on @ref Trade::MeshData
@ -355,7 +355,7 @@ the normal is a packed normalized @relativeref{Magnum,Vector3s}, together with
padding for having vertex boundaries aligned to four bytes to make the GPU
happier:
@snippet MagnumGL.cpp Mesh-formats
@snippet GL.cpp Mesh-formats
@subsection GL-Mesh-configuration-dynamic Dynamically specified attributes
@ -368,7 +368,7 @@ specifying also the stride. Adding a RGB attribute at location 3 normalized
from unsigned byte to float with one byte padding at the end (or, in other
words, stride of four bytes) could then look like this:
@snippet MagnumGL.cpp Mesh-dynamic
@snippet GL.cpp Mesh-dynamic
The @ref DynamicAttribute also allows @ref VertexFormat to be used for
specifying attribute types instead of the rather verbose
@ -376,7 +376,7 @@ specifying attribute types instead of the rather verbose
@relativeref{GL::Attribute,DataOptions} tuple that GL itself accepts. The above
packed position + normal attribute specification would then look like this:
@snippet MagnumGL.cpp Mesh-formats-vertexformat
@snippet GL.cpp Mesh-formats-vertexformat
@subsection GL-Mesh-buffer-ownership Transferring buffer ownership
@ -388,20 +388,20 @@ a @ref Buffer as a rvalue. While this allows you to discard the buffer
instances and pass just the mesh around, it also means you lose a way to access
or update the buffers afterwards.
@snippet MagnumGL.cpp Mesh-buffer-ownership
@snippet GL.cpp Mesh-buffer-ownership
If adding the same buffer multiple times or using it for both vertex and index
data, be sure to transfer the ownership last to avoid the other functions
getting only a moved-out instance. For example:
@snippet MagnumGL.cpp Mesh-buffer-ownership-multiple
@snippet GL.cpp Mesh-buffer-ownership-multiple
@section GL-Mesh-rendering Rendering meshes
With a framebuffer bound and a compatible shader set up, it's only a matter of
calling @ref AbstractShaderProgram::draw():
@snippet MagnumGL.cpp Mesh-draw
@snippet GL.cpp Mesh-draw
@section GL-Mesh-webgl-restrictions WebGL restrictions
@ -866,14 +866,14 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
* accepts only a position and a normal, so you have to skip the weight
* and the texture coordinate in each vertex:
*
* @snippet MagnumGL.cpp Mesh-addVertexBuffer1
* @snippet GL.cpp Mesh-addVertexBuffer1
*
* You can also achieve the same effect by calling @ref addVertexBuffer()
* more times with explicitly specified gaps before and after the
* attributes. This can be used for e.g. runtime-dependent
* configuration, as it isn't dependent on the variadic template:
*
* @snippet MagnumGL.cpp Mesh-addVertexBuffer2
* @snippet GL.cpp Mesh-addVertexBuffer2
*
* If specifying more than one attribute, the function assumes that
* the array is interleaved. Adding non-interleaved vertex buffer can
@ -881,7 +881,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
* Above example with the position and normal arrays one after another
* (non-interleaved):
*
* @snippet MagnumGL.cpp Mesh-addVertexBuffer3
* @snippet GL.cpp Mesh-addVertexBuffer3
*
* If @gl_extension{ARB,vertex_array_object} (part of OpenGL 3.0), OpenGL
* ES 3.0, WebGL 2.0, @gl_extension{OES,vertex_array_object} in OpenGL

2
src/Magnum/GL/MultisampleTexture.h

@ -78,7 +78,7 @@ also @ref AbstractTexture documentation for more information.
As multisample textures have no sampler state, the only thing you need is to
set storage:
@snippet MagnumGL.cpp MultisampleTexture-usage
@snippet GL.cpp MultisampleTexture-usage
In shader, the texture is used via @glsl sampler2DMS @ce / @glsl sampler2DMSArray @ce,
@glsl isampler2DMS @ce / @glsl isampler2DMSArray @ce or @glsl usampler2DMS @ce

2
src/Magnum/GL/OpenGLTester.h

@ -299,7 +299,7 @@ class OpenGLTester: public TestSuite::Tester {
Equivalent to
@snippet MagnumGL.cpp OpenGLTester-MAGNUM_VERIFY_NO_GL_ERROR
@snippet GL.cpp OpenGLTester-MAGNUM_VERIFY_NO_GL_ERROR
*/
#define MAGNUM_VERIFY_NO_GL_ERROR() CORRADE_COMPARE(Magnum::GL::Renderer::error(), Magnum::GL::Renderer::Error::NoError)

2
src/Magnum/GL/PrimitiveQuery.h

@ -42,7 +42,7 @@ namespace Magnum { namespace GL {
Queries count of generated primitives from vertex shader, geometry shader or
transform feedback. Example usage:
@snippet MagnumGL.cpp PrimitiveQuery-usage
@snippet GL.cpp PrimitiveQuery-usage
@see @ref PipelineStatisticsQuery, @ref SampleQuery, @ref TimeQuery,
@ref TransformFeedback

18
src/Magnum/GL/RectangleTexture.h

@ -54,7 +54,7 @@ See also @ref AbstractTexture documentation for more information.
Common usage is to fully configure all texture parameters and then set the
data from e.g. @ref Image2D. Example configuration:
@snippet MagnumGL.cpp RectangleTexture-usage
@snippet GL.cpp RectangleTexture-usage
In a shader, the texture is used via @glsl sampler2DRect @ce,
@glsl sampler2DRectShadow @ce, @glsl isampler2DRect @ce or @glsl usampler2DRect @ce.
@ -393,7 +393,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-image1
* @snippet GL.cpp RectangleTexture-image1
*/
Image2D image(Image2D&& image);
@ -425,7 +425,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-image2
* @snippet GL.cpp RectangleTexture-image2
*/
BufferImage2D image(BufferImage2D&& image, BufferUsage usage);
@ -445,7 +445,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-compressedImage1
* @snippet GL.cpp RectangleTexture-compressedImage1
*/
CompressedImage2D compressedImage(CompressedImage2D&& image);
@ -480,7 +480,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-compressedImage2
* @snippet GL.cpp RectangleTexture-compressedImage2
*/
CompressedBufferImage2D compressedImage(CompressedBufferImage2D&& image, BufferUsage usage);
@ -499,7 +499,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-subImage1
* @snippet GL.cpp RectangleTexture-subImage1
*/
Image2D subImage(const Range2Di& range, Image2D&& image);
@ -532,7 +532,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-subImage2
* @snippet GL.cpp RectangleTexture-subImage2
*/
BufferImage2D subImage(const Range2Di& range, BufferImage2D&& image, BufferUsage usage);
@ -557,7 +557,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-compressedSubImage1
* @snippet GL.cpp RectangleTexture-compressedSubImage1
*/
CompressedImage2D compressedSubImage(const Range2Di& range, CompressedImage2D&& image);
@ -597,7 +597,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp RectangleTexture-compressedSubImage2
* @snippet GL.cpp RectangleTexture-compressedSubImage2
*/
CompressedBufferImage2D compressedSubImage(const Range2Di& range, CompressedBufferImage2D&& image, BufferUsage usage);

4
src/Magnum/GL/Renderer.h

@ -602,7 +602,7 @@ class MAGNUM_GL_EXPORT Renderer {
*
* Convenience equivalent to the following:
*
* @snippet MagnumGL.cpp Renderer-setFeature
* @snippet GL.cpp Renderer-setFeature
*
* Prefer to use @ref enable() and @ref disable() directly to avoid
* unnecessary branching.
@ -1875,7 +1875,7 @@ class MAGNUM_GL_EXPORT Renderer {
* whether your colors / textures have a [premultiplied alpha](https://developer.nvidia.com/content/alpha-blending-pre-or-not-pre)
* (RGB channels always less than or equal to the alpha) or not:
*
* @snippet MagnumGL.cpp Renderer-setBlendFunction
* @snippet GL.cpp Renderer-setBlendFunction
*
* Note that in 3D you need to sort and render transparent objects
* back-to-front after all opaque objects in order for them to appear

4
src/Magnum/GL/SampleQuery.h

@ -43,7 +43,7 @@ Queries count of samples passed from fragment shader or boolean value
indicating whether any samples passed. Can be used for example for conditional
rendering:
@snippet MagnumGL.cpp SampleQuery-usage
@snippet GL.cpp SampleQuery-usage
This approach has some drawbacks, as the rendering is blocked until result is
available for the CPU to decide. This can be improved by using conditional
@ -51,7 +51,7 @@ rendering on GPU itself. The drawing commands will be sent to the GPU and
processed or discarded later, so CPU can continue executing the code without
waiting for the result.
@snippet MagnumGL.cpp SampleQuery-conditional-render
@snippet GL.cpp SampleQuery-conditional-render
@see @ref PipelineStatisticsQuery, @ref PrimitiveQuery, @ref TimeQuery
@requires_gles30 Extension @gl_extension{EXT,occlusion_query_boolean} in

20
src/Magnum/GL/Texture.h

@ -73,7 +73,7 @@ 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
trilinear anisotropic filtering, i.e. the best you can ask for:
@snippet MagnumGL.cpp Texture-usage
@snippet GL.cpp Texture-usage
@attention Note that default configuration is to use mipmaps. Be sure to either
reduce mip level count using @ref setBaseLevel() and @ref setMaxLevel(),
@ -704,7 +704,7 @@ Texture: public AbstractTexture {
* @cpp '1' @ce for zero and one, similarly as in the
* @ref Math::gather() function. Example usage:
*
* @snippet MagnumGL.cpp Texture-setSwizzle
* @snippet GL.cpp Texture-setSwizzle
*
* If @gl_extension{ARB,direct_state_access} (part of OpenGL 4.5) is
* not available, the texture is bound before the operation (if not
@ -888,7 +888,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-image1
* @snippet GL.cpp Texture-image1
*/
Image<dimensions> image(Int level, Image<dimensions>&& image);
@ -929,7 +929,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-image2
* @snippet GL.cpp Texture-image2
*/
BufferImage<dimensions> image(Int level, BufferImage<dimensions>&& image, BufferUsage usage);
@ -974,7 +974,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-compressedImage1
* @snippet GL.cpp Texture-compressedImage1
*/
CompressedImage<dimensions> compressedImage(Int level, CompressedImage<dimensions>&& image);
@ -1018,7 +1018,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-compressedImage2
* @snippet GL.cpp Texture-compressedImage2
*/
CompressedBufferImage<dimensions> compressedImage(Int level, CompressedBufferImage<dimensions>&& image, BufferUsage usage);
@ -1050,7 +1050,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-subImage1
* @snippet GL.cpp Texture-subImage1
*/
Image<dimensions> subImage(Int level, const RangeTypeFor<dimensions, Int>& range, Image<dimensions>&& image);
@ -1092,7 +1092,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-subImage2
* @snippet GL.cpp Texture-subImage2
*/
BufferImage<dimensions> subImage(Int level, const RangeTypeFor<dimensions, Int>& range, BufferImage<dimensions>&& image, BufferUsage usage);
@ -1135,7 +1135,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-compressedSubImage1
* @snippet GL.cpp Texture-compressedSubImage1
*/
CompressedImage<dimensions> compressedSubImage(Int level, const RangeTypeFor<dimensions, Int>& range, CompressedImage<dimensions>&& image);
@ -1182,7 +1182,7 @@ Texture: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp Texture-compressedSubImage2
* @snippet GL.cpp Texture-compressedSubImage2
*/
CompressedBufferImage<dimensions> compressedSubImage(Int level, const RangeTypeFor<dimensions, Int>& range, CompressedBufferImage<dimensions>&& image, BufferUsage usage);
#endif

20
src/Magnum/GL/TextureArray.h

@ -66,13 +66,13 @@ See @ref Texture documentation for introduction.
Common usage is to fully configure all texture parameters and then set the
data. Example configuration:
@snippet MagnumGL.cpp TextureArray-usage1
@snippet GL.cpp TextureArray-usage1
It is often more convenient to first allocate the memory for all layers by
calling @ref setStorage() and then specify each layer separately using
@ref setSubImage():
@snippet MagnumGL.cpp TextureArray-usage2
@snippet GL.cpp TextureArray-usage2
In shader, the texture is used via @glsl sampler1DArray @ce / @glsl sampler2DArray @ce,
@glsl sampler1DArrayShadow @ce / @glsl sampler1DArrayShadow @ce, @glsl isampler1DArray @ce
@ -620,7 +620,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-image1
* @snippet GL.cpp TextureArray-image1
*/
Image<dimensions+1> image(Int level, Image<dimensions+1>&& image);
@ -656,7 +656,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-image2
* @snippet GL.cpp TextureArray-image2
*/
BufferImage<dimensions+1> image(Int level, BufferImage<dimensions+1>&& image, BufferUsage usage);
@ -681,7 +681,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-compressedImage1
* @snippet GL.cpp TextureArray-compressedImage1
*/
CompressedImage<dimensions+1> compressedImage(Int level, CompressedImage<dimensions+1>&& image);
@ -720,7 +720,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-compressedImage2
* @snippet GL.cpp TextureArray-compressedImage2
*/
CompressedBufferImage<dimensions+1> compressedImage(Int level, CompressedBufferImage<dimensions+1>&& image, BufferUsage usage);
@ -744,7 +744,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-subImage1
* @snippet GL.cpp TextureArray-subImage1
*/
Image<dimensions+1> subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, Image<dimensions+1>&& image);
@ -781,7 +781,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-subImage2
* @snippet GL.cpp TextureArray-subImage2
*/
BufferImage<dimensions+1> subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, BufferImage<dimensions+1>&& image, BufferUsage usage);
@ -811,7 +811,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-compressedSubImage1
* @snippet GL.cpp TextureArray-compressedSubImage1
*/
CompressedImage<dimensions+1> compressedSubImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, CompressedImage<dimensions+1>&& image);
@ -854,7 +854,7 @@ TextureArray: public AbstractTexture {
*
* Convenience alternative to the above, example usage:
*
* @snippet MagnumGL.cpp TextureArray-compressedSubImage2
* @snippet GL.cpp TextureArray-compressedSubImage2
*/
CompressedBufferImage<dimensions+1> compressedSubImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, CompressedBufferImage<dimensions+1>&& image, BufferUsage usage);
#endif

4
src/Magnum/GL/TimeQuery.h

@ -40,9 +40,9 @@ Queries timestamp after all previous OpenGL calls have been processed. It can
query either duration of sequence of commands or absolute timestamp. Example
usage of both methods:
@snippet MagnumGL.cpp TimeQuery-usage1
@snippet GL.cpp TimeQuery-usage1
@snippet MagnumGL.cpp TimeQuery-usage2
@snippet GL.cpp TimeQuery-usage2
Using the latter results in fewer OpenGL calls when doing more measures. All
times are reported in nanoseconds.

2
src/Magnum/MaterialTools/RemoveDuplicates.h

@ -66,7 +66,7 @@ The output index array can be passed to @ref SceneTools::mapIndexField() to
update a @ref Trade::SceneField::MeshMaterial field to reference only the
unique materials. For example:
@snippet MagnumMaterialTools.cpp removeDuplicatesInPlace
@snippet MaterialTools.cpp removeDuplicatesInPlace
@see @ref removeDuplicatesInPlaceInto()
*/

4
src/Magnum/Math/Algorithms/KahanSum.h

@ -52,14 +52,14 @@ significantly reduces numerical error in the total. See the
article on Wikipedia for an in-depth explanation. Example with summation of a
hundred million ones:
@snippet MagnumMathAlgorithms.cpp kahanSum
@snippet MathAlgorithms.cpp kahanSum
If required, it is also possible to use this algorithm on non-contiguous ranges
or single values (for example when calculating sum of pixel values in an image
with some row padding or when the inputs are generated / converted from other
values):
@snippet MagnumMathAlgorithms.cpp kahanSum-iterative
@snippet MathAlgorithms.cpp kahanSum-iterative
*/
template<class Iterator, class T = typename std::decay<decltype(*std::declval<Iterator>())>::type> T kahanSum(Iterator begin, Iterator end, T sum = T(0), T* compensation = nullptr) {
T c = compensation ? *compensation : T(0);

2
src/Magnum/Math/Algorithms/Svd.h

@ -72,7 +72,7 @@ Full @f$ \boldsymbol{U} @f$, @f$ \boldsymbol{\Sigma} @f$ matrices and original
@f$ \boldsymbol{M} @f$ matrix can be reconstructed from the values as
following:
@snippet MagnumMathAlgorithms.cpp svd
@snippet MathAlgorithms.cpp svd
One possible use is to decompose a transformation matrix into separate rotation
and scaling parts. Note, however, that the decomposition is not unique. See the

16
src/Magnum/Math/Angle.h

@ -51,28 +51,28 @@ and conversion less error-prone.
You can create the value either by using a literal:
@snippet MagnumMath.cpp Deg-usage
@snippet Math.cpp Deg-usage
Or explicitly convert a unitless value (such as an output from some function)
to either degrees or radians:
@snippet MagnumMath.cpp Deg-usage-convert
@snippet Math.cpp Deg-usage-convert
The classes support all arithmetic operations, such as addition, subtraction
or multiplication/division by a unitless number:
@snippet MagnumMath.cpp Deg-usage-operations
@snippet Math.cpp Deg-usage-operations
It is also possible to compare angles with all comparison operators, but
comparison of degrees and radians is not possible without explicit conversion
to a common type:
@snippet MagnumMath.cpp Deg-usage-comparison
@snippet Math.cpp Deg-usage-comparison
It is possible to seamlessly convert between degrees and radians and explicitly
convert the value back to the underlying type:
@snippet MagnumMath.cpp Deg-usage-conversion
@snippet Math.cpp Deg-usage-conversion
@section Math-Angle-explicit-conversion Requirement of explicit conversion
@ -93,7 +93,7 @@ std::sin(b); // silent error, std::sin() expected radians
These silent errors are easily avoided by requiring explicit conversions:
@snippet MagnumMath.cpp Deg-usage-explicit-conversion
@snippet Math.cpp Deg-usage-explicit-conversion
@see @link Literals::AngleLiterals::operator""_degf() @endlink,
@link Literals::AngleLiterals::operator""_deg() @endlink, @ref Magnum::Deg,
@ -162,7 +162,7 @@ namespace Literals {
Example usage:
@snippet MagnumMath.cpp _deg
@snippet Math.cpp _deg
@see @link operator""_degf() @endlink, @link operator""_rad() @endlink
@m_keywords{_deg deg}
@ -174,7 +174,7 @@ constexpr Deg<Double> operator "" _deg(long double value) { return Deg<Double>(D
Example usage:
@snippet MagnumMath.cpp _degf
@snippet Math.cpp _degf
@see @link operator""_deg() @endlink, @link operator""_radf() @endlink
@m_keywords{_degf degf}

6
src/Magnum/Math/BitVector.h

@ -66,7 +66,7 @@ Value at position 0 is the lowest bit of the first byte passed in constructor.
Value at position 8 is the lowest bit of the second byte passed in constructor.
For example:
@snippet MagnumMath-cpp14.cpp BitVector-indexing
@snippet Math-cpp14.cpp BitVector-indexing
@section Math-BitVector-boolean Boolean operations
@ -80,7 +80,7 @@ returning @cpp true @ce only if all bits are set, this means the condition will
be passed only if @cpp b @ce is around @cpp a @ce in *all dimensions*, and work
the same way as if the variables were just scalars:
@snippet MagnumMath.cpp BitVector-boolean
@snippet Math.cpp BitVector-boolean
@see @ref Magnum::BitVector2, @ref Magnum::BitVector3, @ref Magnum::BitVector4
*/
@ -339,7 +339,7 @@ template<std::size_t size> class BitVector {
In order to avoid potential confusion, prints the value as a comma-separated sequence of binary literals, so the output corresponds to how the value would
be constructed. For example,
@snippet MagnumMath-cpp14.cpp BitVector-debug
@snippet Math-cpp14.cpp BitVector-debug
<b></b>

46
src/Magnum/Math/Color.h

@ -293,7 +293,7 @@ instead. For convenience, conversion from and to 8bpp representation without
sRGB conversion is possible with @ref fromLinearRgbInt() and
@ref toLinearRgbInt().
@snippet MagnumMath.cpp Color3
@snippet Math.cpp Color3
Conversion from and to HSV is done always using floating-point types, so hue
is always in range in range @f$ [0.0\degree, 360.0\degree] @f$, saturation and
@ -429,12 +429,12 @@ template<class T> class Color3: public Vector3<T> {
* representation and want to create a floating-point linear RGB color
* out of it:
*
* @snippet MagnumMath.cpp Color3-fromSrgb
* @snippet Math.cpp Color3-fromSrgb
*
* For conversion from a *linear* 24-bit representation (i.e, without
* applying the sRGB curve), use @ref unpack():
*
* @snippet MagnumMath.cpp Color3-unpack
* @snippet Math.cpp Color3-unpack
*
* @see @ref fromSrgbInt(), @link operator""_srgbf() @endlink,
* @ref Color4::fromSrgbAlpha(const Vector4<Integral>&)
@ -455,7 +455,7 @@ template<class T> class Color3: public Vector3<T> {
* that does this conversion directly from hexadecimal literals. The
* following two statements are equivalent:
*
* @snippet MagnumMath.cpp Color3-fromSrgbInt
* @snippet Math.cpp Color3-fromSrgbInt
*
* Note that the integral value is endian-dependent (the red channel
* being in the *last* byte on little-endian platforms), for conversion
@ -490,7 +490,7 @@ template<class T> class Color3: public Vector3<T> {
* conversion directly from hexadecimal literals. The following two
* statements are equivalent:
*
* @snippet MagnumMath.cpp Color3-fromLinearRgbInt
* @snippet Math.cpp Color3-fromLinearRgbInt
*
* Note that the integral value is endian-dependent (the red channel
* being in the *last* byte on little-endian platforms), for conversion
@ -646,12 +646,12 @@ template<class T> class Color3: public Vector3<T> {
* Useful in cases where you have a floating-point linear RGB color and
* want to create for example an 8-bit sRGB representation out of it:
*
* @snippet MagnumMath.cpp Color3-toSrgb
* @snippet Math.cpp Color3-toSrgb
*
* For conversion to a *linear* 24-bit representation (i.e, without
* applying the sRGB curve), use @ref pack():
*
* @snippet MagnumMath.cpp Color3-pack
* @snippet Math.cpp Color3-pack
*
* @see @ref toSrgbInt(), @ref Color4::toSrgbAlpha(),
* @ref toLinearRgbInt()
@ -841,12 +841,12 @@ class Color4: public Vector4<T> {
* representation and want to create a floating-point linear RGBA color
* out of it:
*
* @snippet MagnumMath.cpp Color4-fromSrgbAlpha
* @snippet Math.cpp Color4-fromSrgbAlpha
*
* For conversion from a *linear* 32-bit representation (i.e, without
* applying the sRGB curve), use @ref unpack():
*
* @snippet MagnumMath.cpp Color4-unpack
* @snippet Math.cpp Color4-unpack
*
* @see @ref fromSrgbAlphaInt(UnsignedInt)
*/
@ -901,7 +901,7 @@ class Color4: public Vector4<T> {
* directly from hexadecimal literals. The following two statements are
* equivalent:
*
* @snippet MagnumMath.cpp Color4-fromSrgbAlphaInt
* @snippet Math.cpp Color4-fromSrgbAlphaInt
*
* Note that the integral value is endian-dependent (the red channel
* being in the *last* byte on little-endian platforms), for conversion
@ -961,7 +961,7 @@ class Color4: public Vector4<T> {
* does this conversion directly from hexadecimal literals. The
* following two statements are equivalent:
*
* @snippet MagnumMath.cpp Color4-fromLinearRgbaInt
* @snippet Math.cpp Color4-fromLinearRgbaInt
*
* Note that the integral value is endian-dependent (the red channel
* being in the *last* byte on little-endian platforms), for conversion
@ -1117,12 +1117,12 @@ class Color4: public Vector4<T> {
* and want to create for example an 8-bit sRGB + alpha representation
* out of it:
*
* @snippet MagnumMath.cpp Color4-toSrgbAlpha
* @snippet Math.cpp Color4-toSrgbAlpha
*
* For conversion to a *linear* 32-bit representation (i.e, without
* applying the sRGB curve), use @ref pack():
*
* @snippet MagnumMath.cpp Color4-pack
* @snippet Math.cpp Color4-pack
*
* @see @ref toSrgbAlphaInt(), @ref toLinearRgbaInt()
*/
@ -1324,7 +1324,7 @@ namespace Literals {
Unpacks the literal into three 8-bit values. Example usage:
@snippet MagnumMath.cpp _rgb
@snippet Math.cpp _rgb
@attention 8bit-per-channel colors are commonly treated as being in sRGB color
space, which is not directly usable in calculations and has to be converted
@ -1346,7 +1346,7 @@ Behaves identically to @link operator""_rgb() @endlink though it doesn't
return a @ref Color3 type to indicate that the resulting value is not linear
RGB. Use this literal to document that given value is in sRGB. Example usage:
@snippet MagnumMath.cpp _srgb
@snippet Math.cpp _srgb
@attention Note that colors in sRGB representation should not be used directly
in calculations --- they should be converted to linear RGB, calculation
@ -1369,7 +1369,7 @@ constexpr Vector3<UnsignedByte> operator "" _srgb(unsigned long long value) {
Unpacks the literal into four 8-bit values. Example usage:
@snippet MagnumMath.cpp _rgba
@snippet Math.cpp _rgba
@attention 8bit-per-channel colors are commonly treated as being in sRGB color
space, which is not directly usable in calculations and has to be converted
@ -1392,7 +1392,7 @@ return a @ref Color4 type to indicate that the resulting value is not linear
RGBA. Use this literal to document that given value is in sRGB + alpha. Example
usage:
@snippet MagnumMath.cpp _srgba
@snippet Math.cpp _srgba
@attention Note that colors in sRGB representation should not be used directly
in calculations --- they should be converted to linear RGB, calculation
@ -1416,7 +1416,7 @@ constexpr Vector4<UnsignedByte> operator "" _srgba(unsigned long long value) {
Equivalent to calling @ref Color3::fromLinearRgbInt() on the literal value.
Example usage:
@snippet MagnumMath.cpp _rgbf
@snippet Math.cpp _rgbf
@attention 8bit-per-channel colors are commonly treated as being in sRGB color
space, which is not directly usable in calculations and has to be converted
@ -1437,7 +1437,7 @@ constexpr Color3<Float> operator "" _rgbf(unsigned long long value) {
Calls @ref Color3::fromSrgbInt() on the literal value. Example usage:
@snippet MagnumMath.cpp _srgbf
@snippet Math.cpp _srgbf
@see @link operator""_srgbaf() @endlink, @link operator""_srgb() @endlink,
@link operator""_rgbf() @endlink
@ -1453,7 +1453,7 @@ inline Color3<Float> operator "" _srgbf(unsigned long long value) {
Equivalent to calling @ref Color4::fromLinearRgbaInt() on the literal value.
Example usage:
@snippet MagnumMath.cpp _rgbaf
@snippet Math.cpp _rgbaf
@attention 8bit-per-channel colors are commonly treated as being in sRGB color
space, which is not directly usable in calculations and has to be converted
@ -1475,7 +1475,7 @@ constexpr Color4<Float> operator "" _rgbaf(unsigned long long value) {
Calls @ref Color4::fromSrgbAlphaInt() on the literal value. Example usage:
@snippet MagnumMath.cpp _srgbaf
@snippet Math.cpp _srgbaf
@see @link operator""_srgbf() @endlink, @link operator""_srgba() @endlink,
@link operator""_rgbaf() @endlink
@ -1508,7 +1508,7 @@ If @ref Debug::Flag::Color is not enabled, the value is printed as a hex color
For example, the following snippet:
@snippet MagnumMath.cpp Color3-debug
@snippet Math.cpp Color3-debug
<b></b>
@ -1541,7 +1541,7 @@ If @ref Debug::Flag::Color is not enabled, the value is printed as a hex color
For example, the following snippet:
@snippet MagnumMath.cpp Color4-debug
@snippet Math.cpp Color4-debug
<b></b>

2
src/Magnum/Math/CubicHermite.h

@ -82,7 +82,7 @@ template<class T> class CubicHermite {
* the end of a curve, simply pass a dummy Bézier segment that
* satisfies this constraint as the other parameter:
*
* @snippet MagnumMath.cpp CubicHermite-fromBezier
* @snippet Math.cpp CubicHermite-fromBezier
*
* Enabled only on vector underlying types. See
* @ref Bezier::fromCubicHermite() for the inverse operation.

2
src/Magnum/Math/Dual.h

@ -116,7 +116,7 @@ template<class T> class Dual {
* Performs only default casting on the values, no rounding or anything
* else. Example usage:
*
* @snippet MagnumMath.cpp Dual-conversion
* @snippet Math.cpp Dual-conversion
*/
template<class U> constexpr explicit Dual(const Dual<U>& other) noexcept: _real{T(other._real)}, _dual{T(other._dual)} {}

2
src/Magnum/Math/Frustum.h

@ -202,7 +202,7 @@ template<class T> class Frustum {
* to check for a point/frustum intersection, similarly to
* @ref Intersection::pointFrustum():
*
* @snippet MagnumMath.cpp Frustum-range
* @snippet Math.cpp Frustum-range
*/
Vector4<T>* begin() { return _data; }

8
src/Magnum/Math/Functions.h

@ -71,11 +71,11 @@ namespace Implementation {
Example usage:
@snippet MagnumMath.cpp div
@snippet Math.cpp div
Equivalent to the following, but possibly done in a single CPU instruction:
@snippet MagnumMath.cpp div-equivalent
@snippet Math.cpp div-equivalent
*/
template<class Integral> inline Containers::Pair<Integral, Integral> div(Integral x, Integral y) {
static_assert(IsIntegral<Integral>::value && IsScalar<Integral>::value,
@ -368,7 +368,7 @@ template<std::size_t size, class T> inline Containers::Pair<Vector<size, T>, Vec
Values smaller than @p min are set to @p min, values larger than @p max are
set to @p max. Equivalent to:
@snippet MagnumMath.cpp clamp
@snippet Math.cpp clamp
<em>NaN</em>s passed in @p value parameter are propagated.
@see @ref min(), @ref max()
@ -569,7 +569,7 @@ another --- for example, the following snippet maps `a` from a range
@f$ [ -1; +1 ] @f$ to a range @f$ [ 5\degree; 15\degree ] @f$; the second
expression combines that with @ref clamp() to ensure the value is in bounds:
@snippet MagnumMath.cpp lerpInverted-map
@snippet Math.cpp lerpInverted-map
@see @ref select()
*/

4
src/Magnum/Math/Half.h

@ -63,13 +63,13 @@ negation operator, a @link Literals::HalfLiterals::operator""_h() @endlink
literal and an @ref operator<<(Debug&, Half) debug operator. Internally the
class uses @ref packHalf() and @ref unpackHalf(). Example usage:
@snippet MagnumMath.cpp Half-usage
@snippet Math.cpp Half-usage
Note that it is also possible to use this type inside @ref Vector classes,
though, again, only for passing data around and converting them, without any
arithmetic operations:
@snippet MagnumMath.cpp Half-usage-vector
@snippet Math.cpp Half-usage-vector
@see @ref Magnum::Half
*/

12
src/Magnum/Math/Intersection.h

@ -298,7 +298,7 @@ template<class T> bool pointCone(const Vector3<T>& point, const Vector3<T>& cone
The @p tanAngleSqPlusOne parameter can be precomputed like this:
@snippet MagnumMath.cpp Intersection-tanAngleSqPlusOne
@snippet Math.cpp Intersection-tanAngleSqPlusOne
*/
template<class T> bool pointCone(const Vector3<T>& point, const Vector3<T>& coneOrigin, const Vector3<T>& coneNormal, T tanAngleSqPlusOne);
@ -327,7 +327,7 @@ template<class T> bool pointDoubleCone(const Vector3<T>& point, const Vector3<T>
The @p tanAngleSqPlusOne parameter can be precomputed like this:
@snippet MagnumMath.cpp Intersection-tanAngleSqPlusOne
@snippet Math.cpp Intersection-tanAngleSqPlusOne
*/
template<class T> bool pointDoubleCone(const Vector3<T>& point, const Vector3<T>& coneOrigin, const Vector3<T>& coneNormal, T tanAngleSqPlusOne);
@ -359,7 +359,7 @@ Transforms the sphere center into cone space (using the cone view matrix) and
performs sphere-cone intersection with the zero-origin -Z axis-aligned cone.
The @p sinAngle and @p tanAngle can be precomputed like this:
@snippet MagnumMath.cpp Intersection-sinAngle-tanAngle
@snippet Math.cpp Intersection-sinAngle-tanAngle
@see @ref MeshTools::boundingSphereBouncingBubble()
*/
@ -400,7 +400,7 @@ normal direction), and behind the plane, where the test is equivalent to
testing whether the origin of the original cone intersects the sphere. The
@p sinAngle and @p tanAngleSqPlusOne parameters can be precomputed like this:
@snippet MagnumMath.cpp Intersection-sinAngle-tanAngleSqPlusOne
@snippet Math.cpp Intersection-sinAngle-tanAngleSqPlusOne
@see @ref MeshTools::boundingSphereBouncingBubble()
*/
@ -446,7 +446,7 @@ cone's axis and are tested for intersection with the cone using
The @p tanAngleSqPlusOne parameter can be precomputed like this:
@snippet MagnumMath.cpp Intersection-tanAngleSqPlusOne
@snippet Math.cpp Intersection-tanAngleSqPlusOne
*/
template<class T> bool aabbCone(const Vector3<T>& aabbCenter, const Vector3<T>& aabbExtents, const Vector3<T>& coneOrigin, const Vector3<T>& coneNormal, T tanAngleSqPlusOne);
@ -478,7 +478,7 @@ Converts the range into center/extents representation and passes it on to
@ref aabbCone(const Vector3<T>&, const Vector3<T>&, const Vector3<T>&, const Vector3<T>&, T) "aabbCone()".
The @p tanAngleSqPlusOne parameter can be precomputed like this:
@snippet MagnumMath.cpp Intersection-tanAngleSqPlusOne
@snippet Math.cpp Intersection-tanAngleSqPlusOne
*/
template<class T> bool rangeCone(const Range3D<T>& range, const Vector3<T>& coneOrigin, const Vector3<T>& coneNormal, const T tanAngleSqPlusOne);

2
src/Magnum/Math/Matrix.h

@ -95,7 +95,7 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
* Performs only default casting on the values, no rounding or
* anything else. Example usage:
*
* @snippet MagnumMath.cpp Matrix-conversion
* @snippet Math.cpp Matrix-conversion
*/
template<class U> constexpr explicit Matrix(const RectangularMatrix<size, size, U>& other) noexcept: RectangularMatrix<size, size, T>(other) {}

4
src/Magnum/Math/Matrix3.h

@ -74,7 +74,7 @@ recommended usage is by creating elementary transformation matrices with
and multiplying them together to form the final transformation --- the
rightmost transformation is applied first, leftmost last:
@snippet MagnumMath.cpp Matrix3-usage
@snippet Math.cpp Matrix3-usage
Conversely, the transformation parts can be extracted back using the member
@ref rotation() const "rotation()", @ref scaling() const "scaling()" and their
@ -440,7 +440,7 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* @ref determinant() is negative, and apply the sign flip to the
* corresponding scaling component instead:
*
* @snippet MagnumMath.cpp Matrix3-rotation-extract-reflection
* @snippet Math.cpp Matrix3-rotation-extract-reflection
*
* @note Extracting rotation part of a matrix with this function may
* cause assertions in case you have unsanitized input (for

4
src/Magnum/Math/Matrix4.h

@ -95,7 +95,7 @@ recommended usage is by creating elementary transformation matrices with
transformation --- the rightmost transformation is applied first, leftmost
last:
@snippet MagnumMath.cpp Matrix4-usage
@snippet Math.cpp Matrix4-usage
Conversely, the transformation parts can be extracted back using the member
@ref rotation() const "rotation()", @ref scaling() const "scaling()" and their
@ -719,7 +719,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* @ref determinant() is negative, and apply the sign flip to the
* corresponding scaling component instead:
*
* @snippet MagnumMath.cpp Matrix4-rotation-extract-reflection
* @snippet Math.cpp Matrix4-rotation-extract-reflection
*
* @note Extracting rotation part of a matrix with this function may
* cause assertions in case you have unsanitized input (for

6
src/Magnum/Math/Packing.h

@ -65,7 +65,7 @@ value in range @f$ [0, 1] @f$ or from *signed* integral to range @f$ [-1, 1] @f$
To ensure the integral type is correctly detected when using literals, this
function should be called with both template parameters explicit, e.g.:
@attention
@snippet MagnumMath.cpp unpack-template-explicit
@snippet Math.cpp unpack-template-explicit
@see @ref pack(), @ref unpackInto()
*/
@ -77,7 +77,7 @@ template<class FloatingPoint, class Integral> inline FloatingPoint unpack(const
Alternative to the above with ability to specify how many bits of the integral
representation to use. Example usage:
@snippet MagnumMath.cpp unpack
@snippet Math.cpp unpack
*/
template<class FloatingPoint, class Integral, UnsignedInt bits> inline FloatingPoint unpack(const Integral& value);
#else
@ -161,7 +161,7 @@ template<class Integral, std::size_t size, class FloatingPoint, UnsignedInt bits
Alternative to the above with ability to specify how many bits of the integral
representation to use. Example usage:
@snippet MagnumMath.cpp pack
@snippet Math.cpp pack
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class Integral, UnsignedInt bits, class FloatingPoint> inline Integral pack(FloatingPoint value);

4
src/Magnum/Math/Quaternion.h

@ -502,7 +502,7 @@ template<class T> class Quaternion {
* back, you do the following, replace it with an X axis for a zero
* angle:
*
* @snippet MagnumMath.cpp Quaternion-axis-nan
* @snippet Math.cpp Quaternion-axis-nan
*
* @see @ref isNormalized(), @ref rotation()
*/
@ -523,7 +523,7 @@ template<class T> class Quaternion {
* Expects that the quaternion is normalized. Returns the angles in an
* XYZ order, you can combine them back to a quaternion like this:
*
* @snippet MagnumMath.cpp Quaternion-fromEuler
* @snippet Math.cpp Quaternion-fromEuler
*
* @see @ref rotation(), @ref DualQuaternion::rotation()
*/

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save