Changelog
See also:
Changes since 2020.06
Dependency changes
- Minimal supported CMake version is now 3.5, changed from 3.4, since CMake 3.27+ warns if a compatibility with CMake below 3.5 is requested. Older versions are not supported anymore and all workarounds for them were removed. This is a conservative change, as there are no known supported distributions which would have anything older than 3.5.
- Minimal supported CMake version for Emscripten WebGL 2 compilation is now 3.13, in order to be able to set linker options for enabling WebGL 2 without having to pollute the global
CMAKE_EXE_LINKER_FLAGS
variable. - Minimal supported Emscripten version is now 1.39.5 which implicitly sets
-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
, as the deprecated code paths were removed. - Support for Android API versions older than 14 (i.e., before Android 4.0, which is from 2011) has been dropped from Platform::
AndroidApplication. - Support for SDL2 older than 2.0.6 (released in 2017) has been dropped from Platform::
Sdl2Application. - Support for GLFW older than 3.2 (released in 2016) has been dropped from Platform::
GlfwApplication.
New features
- MSVC 2022 support. See also mosra/
corrade#124 and mosra/ magnum#552. - New NoAllocate constructor tag, to be used by the Vk library
- New DefaultInit constructor tag, simply an alias to the existing Corrade::
DefaultInit tag - New PixelFormat::
Depth16Unorm, Depth24Unorm, Depth32F, Stencil8UI, Depth16UnormStencil8UI, Depth24UnormStencil8UI, Depth32FStencil8UI generic pixel formats, including mapping to GL:: PixelFormat / GL:: PixelType, GL:: TextureFormat and Vk:: PixelFormat and (partial) support in DebugTools:: CompareImage - New pixelFormatChannelFormat(), pixelFormatChannelCount(), isPixelFormatNormalized(), isPixelFormatIntegral(), isPixelFormatFloatingPoint(), isPixelFormatSrgb(), isPixelFormatDepthOrStencil(), pixelFormat(PixelFormat, UnsignedInt, bool), isCompressedPixelFormatNormalized(), isCompressedPixelFormatFloatingPoint() and isCompressedPixelFormatSrgb() helpers
- New Degh, Radh, Range1Dh, Range2Dh and Range3Dh typedefs for half-float angles and ranges
- New Range1Dui, Range2Dui and Range3Dui typedefs for unsigned integer ranges
- New Nanoseconds and Seconds typedefs for time values
- New Matrix2x1, Matrix3x1, Matrix4x1 typedefs for single-row matrices as a counterpart for column vectors, together with corresponding double variants and type aliases in the Math library
- Added MSVC Natvis files and pretty-printers for GDB. See Debugger support, mosra/
magnum#589, mosra/ magnum#595, mosra/ magnum#620, mosra/ magnum#623, mosra/ magnum#653 and mosra/ corrade#179 for more information.
DebugTools library
- Added DebugTools::
ColorMap:: coolWarmSmooth() and DebugTools:: ColorMap:: coolWarmBent() (see mosra/ magnum#473) - New DebugTools::
CompareMaterial comparator for convenient comparison of Trade:: MaterialData instances
GL library
- New GL::
AbstractShaderProgram:: draw(Mesh&, const Containers:: StridedArrayView1D<const UnsignedInt>&, const Containers:: StridedArrayView1D<const UnsignedInt>&, const Containers:: StridedArrayView1D<const UnsignedInt>&) overload for data-oriented multi-draw workflows without GL:: MeshView and internal temporary allocations - Implemented ANGLE- and WebGL-specific instanced multidraw with GL::
AbstractShaderProgram:: draw(Mesh&, const Containers:: StridedArrayView1D<const UnsignedInt>&, const Containers:: StridedArrayView1D<const UnsignedInt>&, const Containers:: StridedArrayView1D<const UnsignedInt>&, const Containers:: StridedArrayView1D<const UnsignedInt>&, const Containers:: StridedArrayView1D<const UnsignedInt>&). It's added mainly in order to provide a fast rendering path on resource-constrainted systems and as such doesn't have an overload taking GL:: MeshView instances or a fallback path when the multidraw extensions are not available. - New GL::
Context:: Configuration class providing runtime alternatives to the --magnum-log
,--magnum-gpu-validation
,--magnum-disable-extensions
and--magnum-disable-workarounds
command line options. The class is then inherited by all Platform::*Application:: GLConfiguration and Platform:: Windowless*Application:: Configuration classes. - The
--magnum-gpu-validation
option accepts a new value,no-error
, which creates OpenGL contexts without error reporting. Those may result in better performance on certain drivers, however note that errors on such context have undefined behavior and may cause stability issues. This option is also programatically settable via a new GL::Context:: Configuration:: Flag:: GpuValidationNoError flag. - Implemented the GL 4.3 ARB_
framebuffer_ no_ attachments extension and matching GLES 3.1 functionality, exposed as GL:: Framebuffer:: setDefaultSize() and related APIs - Implemented the GL 4.3 ARB_
texture_ view extension and matching OES_ texture_ view and EXT_ texture_ view extensions on GLES 3.1+, exposed as GL:: Texture:: view() and similar APIs on other texture types - Implemented the GL 4.5 ARB_
clip_ control extension and matching EXT_ clip_ control extension on GLES and WebGL, exposed as GL:: Renderer:: setClipControl(). See also mosra/ magnum#543. - Implemented EXT_
texture_ norm16 and EXT_ texture_ norm16 ES and WebGL extensions, making normalized 16-bit texture and renderbuffer formats available on all platforms - The EXT_
texture_ sRGB_ RG8 extension is now available on desktop OpenGL as well, exposing a two-component sRGB format in addition to the already present one-, three- and four-component formats - Implemented WEBGL_
blend_ equation_ advanced_ coherent extension, making advanced GL:: Renderer:: BlendEquation values available on all platforms - Implemented EXT_
frag_ depth WebGL 1.0 extension (shading language only) - Implemented WEBGL_
debug_ renderer_ info as GL:: Context:: rendererStringUnmasked() and vendorStringUnmasked() together with printing those in the engine startup log if the extension is available and expanding the capabilities of GL:: Context:: detectedDriver() on WebGL. It also resulted in a new "firefox-deprecated-debug-renderer-info"
workaround being added, see Driver workarounds for more info. - Implemented the EXT_
depth_ clamp WebGL extension, making GL:: Renderer:: Feature:: DepthClamp available on all platforms - Implemented the EXT_
texture_ mirror_ clamp_ to_ edge ES and WebGL extensions, making GL:: SamplerWrapping:: MirrorClampToEdge available on all platforms - Implemented the ANGLE_
provoking_ vertex ES extension. Recognized also on WebGL as WEBGL_ provoking_ vertex but with no implementation as Emscripten doesn't have the required entrypoints yet. - Implemented the ANGLE_
polygon_ mode and WEBGL_ polygon_ mode ES and WebGL extension. - Implemented the ANGLE_
stencil_ texturing ES and WEBGL_ stencil_ texturing WebGL extensions - Implemented the EXT_
blend_ func_ extended ES and WEBGL_ blend_ func_ extended WebGL extensions - Implemented the INTEL_
blackhole_ render desktop and ES extension - Recognizing EXT_
float_ blend, EXT_ polygon_ offset_ clamp and WEBGL_ debug_ shaders WebGL extensions, no implementation done yet - Implemented Async shader compilation and linking including the KHR_
parallel_ shader_ compile GL, GLES and KHR_ parallel_ shader_ compile WebGL extension (see mosra/ magnum#534 and mosra/ magnum#576) - Recognizing ANGLE GLES and WebGL base vertex, base instance and multi-draw extensions and using them in GL::
AbstractShaderProgram:: draw(Mesh&) and GL:: AbstractShaderProgram:: draw(const Containers:: Iterable<MeshView>&): - Recognizing ANGLE_
compressed_ texture_ etc OpenGL ES and WEBGL_ compressed_ texture_ etc WebGL extensions, making ETC and EAC GL:: CompressedPixelFormat and GL:: TextureFormat values available also on OpenGL ES 2.0 and WebGL. The values were already present in WebGL 2.0 builds by accident before, without documenting corresponding extension requirements. - Recognizing the NV_
geometry_ shader_ passthrough extension - Added a GL::
AbstractTexture:: target() getter to simplify interaction with raw GL code - Exposed the ARB_
buffer_ storage desktop and EXT_ buffer_ storage ES extensions as GL:: Buffer:: setStorage() together with additions to GL:: Buffer:: MapFlag - It's now possible to modify index offset via GL::
Mesh:: setIndexOffset() directly on the mesh itself instead of just through GL:: MeshView - Exposed missing GL::
Renderer:: Feature:: SampleAlphaToCoverage, Feature:: SampleAlphaToOne, Feature:: SampleCoverage and GL:: Renderer:: setSampleCoverage() GL 1.3 APIs - Using the non-clamping NV_
depth_ buffer_ float entrypoints in GL:: Renderer:: setClearDepth() and a newly exposed GL:: Renderer:: setDepthRange() if the extension is available. See also mosra/ magnum#543 and mosra/ magnum#558. - A new
"nv-egl-crashy-query-device-attrib"
workaround for a crash happening during EGL initialization in recent NVidia drivers. See Driver workarounds and mosra/magnum#491 for more information. - A new
"angle-chatty-shader-compiler"
workaround for silencing useless linker output on ANGLE. See Driver workarounds for more information. - A new
"android-generic-hostname-might-be-swiftshader"
workaround needed for testing against Android Emulator SwiftShader GPU. See Driver workarounds for more information. - A new
"angle-instanced-attributes-always-draw-instanced"
workaround for ANGLE's draw validation bug, where it complained about instanced buffers being too small when drawing such mesh as non-instanced. See Driver workarounds for more information, see also mosra/magnum#539. - A new
"adreno-glsl-version-stuck-at-300"
workaround for an incorrect__VERSION__
reported for GLSL ES 3.10 and 3.20 shaders on Qualcomm Adreno drivers that caused builtin shaders to have broken rendering or even crash. See Driver workarounds and mosra/magnum#618 for more information. - A new
"mesa-broken-dsa-framebuffer-clear"
workaround for a crash on exit happening with Mesa 24 when the DSA variants of GL::Framebuffer:: clearColor() and related APIs are used. See Driver workarounds for more information.
Math library
- Added Math::
fmod() (see mosra/ magnum#454) - Added Math::
binomialCoefficient() (see mosra/ magnum#461) - Added Math::
popcount() - Added Math::
Color3:: fromLinearRgbInt(), Math:: Color4:: fromLinearRgbInt() and Math:: Color4:: fromLinearRgbaInt() as counterparts to Math:: Color3:: fromSrgbInt(), Math:: Color4:: fromSrgbInt() and Math:: Color4:: fromSrgbAlphaInt() that don't perform a sRGB conversion - New Math::
DualComplex:: from(const Complex<T>&, const Vector2<T>&) and Math:: DualQuaternion:: from(const Quaternion<T>&, const Vector3<T>&) functions mirroring Math:: Matrix3:: from(const Matrix2x2<T>&, const Vector2<T>&) and Math:: Matrix4:: from(const Matrix3x3<T>&, const Vector3<T>&) to create a transformation from a rotation and translation part (see mosra/ magnum#471) - Added Math::
Matrix4:: orthographicProjection(const Vector2<T>&, const Vector2<T>&, T, T) and Math:: Matrix3:: projection(const Vector2<T>&, const Vector2<T>&) to match the classic glOrtho()
andgluOrtho2D()
APIs, complementing Math::Matrix4:: perspectiveProjection(const Vector2<T>&, const Vector2<T>&, T, T) that got added in 2019.10 - New Math::
Matrix4:: orthographicProjectionNear() const, Math:: Matrix4:: orthographicProjectionFar() const, Math:: Matrix4:: perspectiveProjectionNear() const and Math:: Matrix4:: perspectiveProjectionFar() const queries - Added Math::
Intersection:: rayRange() (see mosra/ magnum#484) - Added Math::
RectangularMatrix:: RectangularMatrix(IdentityInitT, T) constructor as it might be useful to create non-square identity matrices as well - Added Math::
Distance:: pointPoint() and Math:: Intersection:: pointCircle() / pointSphere(), which are just wrappers over trivial code but easier to discover - Added an unary
operator+()
to all Math classes - Added Math::
Quaternion:: rotation(const Vector3<T>&, const Vector3<T>&) for creating a quaternion that rotates from one vector to another - Added Math::
Quaternion:: reflection() and Math:: Quaternion:: reflectVector(), but mainly just for documentation purposes as reflections cannot be combined with rotations and thus are mostly useless in practice - New Magnum/
Math/ ColorBatch.h header with utilities for performing Y flip of various block-compressed formats - New Math::
Nanoseconds and Math:: Seconds classes for strongly typed representation of time values - Math::
Vector, Math:: RectangularMatrix and all their subclasses can be now constructed from fixed-size arrays without having to use the potentially dangerous and non-constexpr Math:: Vector:: from() API
MaterialTools library
- New MaterialTools library providing various material conversion utilities
MeshTools library
- New MeshTools::
boundingSphereBouncingBubble() algorithm for calculating a tight bounding sphere for a mesh, along with a trivial MeshTools:: boundingRange() for AABBs (see mosra/ magnum#557) - Added MeshTools::
generateTrivialIndices() as a STL-less alternative to std:: iota() - Added MeshTools::
generateQuadIndices() for quad triangulation including non-convex and non-planar quads - New MeshTools::
filterAttributes(), MeshTools:: filterOnlyAttributes() and MeshTools:: filterExceptAttributes() utilities for filtering mesh data attribute lists - New family of MeshTools::
transform2D(), MeshTools:: transform3D() and MeshTools:: transformTextureCoordinates2D() APIs for converting positions, normals, tangents, bitangents and texture coordinates directly in Trade:: MeshData instances - New MeshTools::
compileLines() utility for creating meshes compatible with the new Shaders:: LineGL. See also mosra/ magnum#601. - New MeshTools::
interleave(MeshPrimitive, const Trade:: MeshIndexData&, Containers:: ArrayView<const Trade:: MeshAttributeData>) overload for conveniently creating an interleaved mesh out of loose index and attribute arrays
Platform libraries
- It's now possible to have multiple Platform::
EmscriptenApplication canvases on a single page (see mosra/ magnum#480, mosra/ magnum#481) - Added release() as a counterpart to makeCurrent() to all
Platform::Windowless*Context
classes. Useful for transferring OpenGL contexts between threads, see also mosra/magnum#495. - Implemented Configuration::
Flag:: NoError in Platform:: WindowlessEglApplication, Platform:: WindowlessGlxApplication, Platform:: WindowlessWglApplication and Platform:: Sdl2Application - New Platform::
EmscriptenApplication:: GLConfiguration:: Flag:: PowerPreferenceLowPower and Flag:: PowerPreferenceHighPerformance flags allowing to pick either a low power, high performance or default behavior (see mosra/ magnum#500). - Added Platform::
GlfwApplication:: setMinimalLoopPeriod() and tickEvent() to match the interface of Platform:: Sdl2Application (see mosra/ magnum#577 and mosra/ magnum#580) - Multi-touch support in Platform::
Sdl2Application, Platform:: EmscriptenApplication and Platform:: AndroidApplication through new PointerEvent and PointerMoveEvent that unify mouse, pen and touch input events. This also means Platform:: EmscriptenApplication finally supports touch drag (mosra/ magnum#532) — no touch-to-mouse event passthrough needs to be implemented, it works out of the box with the new pointer events. The Android implementation is building upon mosra/ magnum#527. There's also a new Platform:: TwoFingerGesture helper for recognition of common two-finger gestures for zoom, rotation and pan.
SceneGraph library
SceneTools library
- New SceneTools library that'll be a home for various whole-scene optimization algorithms such as hierarchy flattening, redundant node removal and such
- The magnum-sceneconverter utility now supports whole-scene conversion instead of operating just on single meshes
- The magnum-sceneconverter utility gained an experimental
--concatenate-meshes
option, which will flatten the mesh hierarchy and concatenate all meshes together. Note that it doesn't correctly handle all corner cases yet and may assert on certain inputs. - Added a
--phong-to-pbr
option to the magnum-sceneconverter utility to perform conversion of Phong materials to PBR, useful for example when converting old OBJ and COLLADA files to glTF - The magnum-sceneconverter
--info
output is now more compact and colored for better readability - Added
--info-importer
,--info-converter
and--info-image-converter
options to magnum-sceneconverter, listing plugin features and configuration file contents
Shaders library
- New Shaders::
LineGL shader for rendering wide anti-aliased lines with configurable join and cap rasterization. See also mosra/ magnum#601 and mosra/ magnum#610. - All builtin shaders now have opt-in support for uniform buffers on desktop, OpenGL ES 3.0+ and WebGL 2.0, as well as shader storage buffers on desktop and ES 3.1+. This includes multi-draw functionality for massive driver overhead reduction. The Builtin shaders overview page was updated with an introduction to the new features.
- All builtin shaders now have opt-in capability of async compilation and linking (see mosra/
magnum534 and mosra/ magnum#576) - Shaders::
FlatGL and Shaders:: PhongGL now support texture arrays, available also in multi-draw and instanced scenarios - Shaders::
FlatGL and Shaders:: PhongGL now support object ID textures in addition to uniform and per-vertex object ID - Shaders::
MeshVisualizerGL2D and Shaders:: MeshVisualizerGL3D now supports object ID textures same as Shaders:: FlatGL and Shaders:: PhongGL, including also support for object ID texture transformation, instanced texture offset and texture arrays - Support for instanced drawing in Shaders::
MeshVisualizerGL2D and Shaders:: MeshVisualizerGL3D for better feature parity with the other shaders - New Shaders::
Generic:: JointIds, Shaders:: Generic:: SecondaryJointIds, Shaders:: Generic:: Weights and Shaders:: Generic:: SecondaryWeights attributes for GPU skinning support (see also mosra/ magnum#441) - GPU skinning support in Shaders::
FlatGL, Shaders:: PhongGL and Shaders:: MeshVisualizerGL2D / Shaders:: MeshVisualizerGL3D (see also mosra/ magnum#444 and mosra/ magnum#506) - Added Shaders::
PhongGL:: setNormalTextureScale(), consuming the recently added Trade:: MaterialAttribute:: NormalTextureScale material attribute - Shaders::
PhongGL was reworked to support directional and range-attenuated point lights to follow the additions to Trade:: LightData - Added Shaders::
PhongGL:: setLightSpecularColors() for better control over specular highlights - Added Shaders::
PhongGL:: Flag:: NoSpecular as a significantly faster alternative to setting specular color to 0x00000000_rgbaf
in case specular highlights are not desired - Added Shaders::
PhongGL:: Flag:: DoubleSided for rendering double-sided meshes
ShaderTools library
- New ShaderTools library that provides a ShaderTools::
AbstractConverter plugin interface for shader validation, conversion, compilation and optimization; together with a AnyShaderConverter plugin and a magnum-shaderconverter utility
Text library
- New Text::
AbstractShaper interface returned by Text:: AbstractFont and associated Text:: Script, Text:: Feature and Text:: ShapeDirection enums allowing full control over script, language, direction and used typographic features of shaped text - Reworked Text::
AbstractGlyphCache on top of TextureTools:: AtlasLandfill allowing more efficient and incremental glyph packing together with support for texture arrays - New Text::
renderLineGlyphPositionsInto(), Text:: renderGlyphQuadsInto(), Text:: alignRenderedLine(), Text:: alignRenderedBlock() and Text:: renderGlyphQuadIndicesInto() APIs providing low-level access to the text renderer building blocks - New Text::
glyphRangeForBytes() API for providing byte-to-glyph mapping for arbitrarily complex shapers using the output from Text:: AbstractShaper:: glyphClustersInto()
TextureTools library
- New TextureTools::
AtlasLandfill texture atlas packer (see mosra/ magnum#2) - New TextureTools::
atlasArrayPowerOfTwo() utility for optimal packing of power-of-two textures into a texture atlas array - New TextureTools::
atlasTextureCoordinateTransformation() helper for creating an appropriate texture coordinate transformation matrix for textures placed into an atlas - Added a TextureTools::
DistanceFieldGL:: operator()() overload taking a GL:: Framebuffer instead of a GL:: Texture as an output for an easier ability to download the resulting image on OpenGL ES platforms; the magnum-distancefieldconverter utility thus now compiles and works on OpenGL ES 3+ as well
Trade library
- A new, redesigned Trade::
MaterialData class allowing to store custom material attributes as well as more material types together in a single instance; plus new Trade:: FlatMaterialData, Trade:: PbrMetallicRoughnessMaterialData, Trade:: PbrSpecularGlossinessMaterialData and Trade:: PbrClearCoatMaterialData convenience accessor APIs similar to Trade:: PhongMaterialData. See mosra/ magnum#459. - Added Trade::
PhongMaterialData:: hasSpecularTexture(), Trade:: PhongMaterialData:: specularTextureSwizzle(), Trade:: PhongMaterialData:: normalTextureScale() and Trade:: PhongMaterialData:: normalTextureSwizzle() to make new features added for PBR materials recognizable also in classic Phong workflows. - A completely redesigned Trade::
SceneData class that stores data of the whole scene in a data-oriented way, allowing for storing custom fields as well. See mosra/ magnum#525. - New Trade::
SkinData class and Trade:: AbstractImporter:: skin2D() / Trade:: AbstractImporter:: skin3D() family of APIs for skin import, as well as support in AnySceneImporter - New builtin Trade::
MeshAttribute:: JointIds and Trade:: MeshAttribute:: Weights attributes for skinning (see mosra/ magnum#441) - The Trade::
AbstractSceneConverter plugin interface gained support for batch conversion of whole scenes — meshes, hierarchies, materials, textures, animations and other data; AnySceneConverter is updated to support batch conversion as well - 1D and 3D image support in Trade::
AbstractImageConverter - Trade::
LightData got extended to support light attenuation and range parameters as well and spot light inner and outer angle - Trade::
AbstractImporter, Trade:: AbstractImageConverter and Trade:: AbstractSceneConverter now has addFlags() and clearFlags() convenience helpers that are encouraged over setFlags() as it avoid accidentally clearing default flags potentially added in the future. - New Trade::
AbstractImporter:: openMemory() function for passing non-temporary memory to the importer, allowing the implementations to avoid allocating an internal copy; for benchmarking and testing purposes it's also exposed via a --map
option in the magnum-sceneconverter and magnum-imageconverter utilities - Added Trade::
animationTrackTypeSize() and Trade:: animationTrackTypeAlignment() for API consistency with other type enums - Added Trade::
isAnimationTrackTargetCustom() and Trade:: animationTrackTargetCustom() helpers as well as Trade:: AbstractImporter:: animationTrackTargetName() and Trade:: AbstractImporter:: animationTrackTargetForName() queries for associating custom Trade:: AnimationTrackTarget values with string names consistently with what's already done for Trade:: MeshAttribute and Trade:: SceneField - Ability to convert also 1D and 3D images with the magnum-imageconverter utility, as well as combining layers into images of one dimension more (or vice versa), creating multi-level images from separate input files and chaining multiple converters together
- The magnum-imageconverter
--info
output is now more compact and colored for better readability - Added
--info-importer
and--info-converter
options to magnum-imageconverter, listing plugin features and configuration file contents
Vk library
- Boostrapping Vulkan support (mosra/
magnum#234), in particular: - Vk::
LayerProperties, Vk:: InstanceExtensionProperties and Vk:: enumerateInstanceVersion() APIs for querying instance-level properties - Vk::
DeviceProperties and Vk:: ExtensionProperties for querying device-level properties - Vk::
Instance and Vk:: Device APIs for instance and device creation and fetching instance/device-specific function pointers, Vk:: Queue setup. See also mosra/ magnum#549. - Vk::
CommandPool and Vk:: CommandBuffer wrappers - Initial implementations of Vk::
Memory, Vk:: Buffer and Vk:: Image - Vk::
Shader wrapper - New magnum-vk-info utility, a Vulkan-specific counterpart for magnum-gl-info
- Initial documentation, in particular Support state, Vulkan wrapping layer and API mapping
- Vk::
Changes and improvements
- Added MeshPrimitive::
Meshlets as a placeholder for future meshlet support in Trade:: MeshData - MeshIndexType was enlarged to 32 bits and can now wrap implementation-specific values similar to PixelFormat, CompressedPixelFormat, VertexFormat and MeshPrimitive
- Image::
size(), CompressedImage:: size(), ImageView:: size(), CompressedImageView:: size() as well as Trade:: ImageData:: size() now return a const&
instead of a value to allow creating a Containers::StridedArrayView slice onto this member. - Image, CompressedImage, ImageView, CompressedImageView as well as Trade::
ImageData are now able to annotate array, cube map and cube map array images using ImageFlags - Removed unnecessary std::
string usage from certain Utility:: ConfigurationValue specializations (see mosra/ magnum#582) - Added Timeline::
currentFrameTime() and currentFrameDuration() counterparts to previousFrameTime() and previousFrameDuration() (see mosra/ magnum#604) - Added MAGNUM_
AUDIO_ ABSTRACTIMPORTER_ PLUGIN_ INTERFACE, MAGNUM_ SHADERTOOLS_ ABSTRACTCONVERTER_ PLUGIN_ INTERFACE, MAGNUM_ TEXT_ ABSTRACTFONT_ PLUGIN_ INTERFACE, MAGNUM_ TEXT_ ABSTRACTFONTCONVERTER_ PLUGIN_ INTERFACE, MAGNUM_ TRADE_ ABSTRACTIMPORTER_ PLUGIN_ INTERFACE, MAGNUM_ TRADE_ ABSTRACTIMAGECONVERTER_ PLUGIN_ INTERFACE and MAGNUM_ TRADE_ ABSTRACTSCENECONVERTER_ PLUGIN_ INTERFACE defines with plugin interface strings to avoid having to update them by hand in every plugin every time the interface version is bumped after an ABI break
Animation library
- Added a Animation::
Easingd typedef with easing functions implemented with double precision, in addition to single-precision Animation:: Easing, and similar in spirit to the Constants and Constantsd typedefs. - Added Animation::
TrackViewStorage:: interpolator() for getting a type-erased interpolator pointer without having to cast to a concrete Animation:: TrackView type
Audio library
- All configurable OpenAL context properties are now exposed via Audio::
Context:: frequency(), monoSourceCount(), stereoSourceCount() and refreshRate() getters. These are now also listed in the magnum-al-info utility, along with a possibility to override them there.
DebugTools library
- DebugTools::
bufferData() and DebugTools:: bufferSubData() now falls back to GL:: Buffer:: subData() on desktop GL instead of always relying on memory-mapping, and is now available on WebGL 2 as well (see mosra/ magnum#560) - DebugTools::
CompareImage now supports comparing half-float pixel formats as well, pixel format autodetection for pixel views tries to match sRGB and normalization properties of the expected image format - DebugTools::
CompareImage now accepts MutableImageView2D as well, in addition to Image2D, ImageView2D and Trade:: ImageData2D - DebugTools::
textureSubImage() now checks that the framebuffer is complete before attempting to read from it to avoid silent failures when the texture format isn't framebuffer readable
GL library
- GL::
AbstractShaderProgram:: draw(), drawTransformFeedback() and dispatchCompute() APIs now return a reference to self and all subclasses in Shaders return a subclass reference from these. The functions used to void
as that made more sense in the classic workflow where a large set of uniforms had to be set prior to every draw, however with the new multidraw workflows that's no longer the case and the inability to chain draw calls proved to be annoying. - Single-value GL::
AbstractShaderProgram:: setUniform() calls now go directly instead of through the pointer variant of glUniform() APIs, leading to less garbage generated on WebGL and circumventing certain driver bugs (see mosra/ magnum#591 and mosra/ magnum#592) - Added an GL::
AbstractShaderProgram:: setTransformFeedbackOutputs() overload taking a Containers:: ArrayView instead of a std:: initializer_list - Added GL::
Buffer:: bind() and GL:: TransformFeedback:: attachBuffers() overloads taking a Containers:: ArrayView instead of a std:: initializer_list (see mosra/ magnum#588) - GL::
Buffer:: data() and GL:: Buffer:: subData() is now available on WebGL 2.0 as well if Emscripten 2.0.17+ is used (see mosra/ magnum#560) - The GL::
Context class got significantly optimized in terms of compile time, header size and runtime as well, significantly reducing the amount of allocations done at startup. - Added GL::
Context:: DetectedDriver:: QualcommAdreno - To make working with cube map images easier, GL::
CubeMapTexture:: setSubImage() and GL:: CubeMapTexture:: subImage() taking 3D images are now exposed on all platforms, not just desktop OpenGL 4.5+, with a fall back to slice-by-slice upload/download where needed. The compressed variant is still only GL 4.5+, as that needs the CompressedImageView APIs to be aware of compression format properties, which isn't implemented yet. - Added GL::
DefaultFramebuffer:: mapForDraw(), GL:: Framebuffer:: mapForDraw(), GL:: DefaultFramebuffer:: invalidate() and GL:: Framebuffer:: invalidate() overloads taking a Containers:: ArrayView instead of a std:: initializer_list - Added GL::
Framebuffer:: Status:: IncompleteDimensions for ES2. This enum isn't available on ES3 or desktop GL, but NVidia drivers are known to emit it, which is why it got added. - Intel/Windows-specific code for silencing useless shader compiler output is now advertised as a
"intel-windows-chatty-shader-compiler"
workaround, instead of being done silently. See Driver workarounds for more information. - Platform::
Windowless*Application instances no longer touch default framebuffer state in order to avoid potential race conditions with a windowed context on another thread. This is also exposed via a new GL:: Context:: Configuration:: Flag:: Windowless flag for integration with custom-created OpenGL contexts. See also mosra/ magnum#493 and mosra/ magnum#494. - The GL::
defaultFramebuffer global now deduplicates its state when a statically-built Magnum is linked to multiple shared libraries, following what the global GL:: Context:: current() already does - Added GL::
Framebuffer:: InvalidationAttachment:: DepthStencil to complement Depth and Stencil (see mosra/ magnum#554) - GL::
Renderer:: Feature:: DepthClamp is now exposed on OpenGL ES as well, using the EXT_ depth_ clamp extension - Added GL::
Shader:: wrap() and release() - GL::
Shader now adds defines for driver workarounds that affect shader code. Until now this was done only internally for builtin shaders, now it's done for all. - New MAGNUM_
GL_ ABSTRACTSHADERPROGRAM_ SUBCLASS_ DRAW_ IMPLEMENTATION() and MAGNUM_ GL_ ABSTRACTSHADERPROGRAM_ SUBCLASS_ DISPATCH_ IMPLEMENTATION() macros for easier and more robust implementation of method chaining in GL:: AbstractShaderProgram subclasses - Recognizing OES_
draw_ buffers_ indexed and WEBGL_ clip_ cull_ distance WebGL extensions that were renamed from EXT_draw_buffers_indexed
andEXT_clip_cull_distance
in March 2020 and January 2023. The old names are still recognized and present in GL::Extensions for compatibility with older browsers. - Re-enabled glDrawRangeElements() for WebGL 2, this time hopefully for the last time (see mosra/
magnum#97) - Added GL::
genericPixelFormat() and GL:: genericCompressedPixelFormat() helpers for convenient mapping of GL:: PixelFormat, GL:: PixelType, GL:: CompressedPixelFormat and GL:: TextureFormat values back to the generic PixelFormat and CompressedPixelFormat
Math library
- Assertions in all Math APIs except for batch functions in Magnum/
Math/ PackingBatch.h and Magnum/ Math/ FunctionsBatch.h were changed to debug-only for better performance in release builds - Added Math::
BitVector:: set(std:: size_t) and Math:: BitVector:: reset(std:: size_t) for branchless bit setting - Added Math::
castInto() overloads for casting between UnsignedByte and UnsignedShort or Byte and Short, from and to UnsignedLong / Long, between integral types and Double and for casting between Float and Double - Math::
RectangularMatrix is now explicitly convertible from matrices of different sizes, with a possibility to specify whether to fill the diagonal or leave it as zeros. This was originally available only on (square) Math:: Matrix from other square matrices where it implicitly filled the diagonal to an identity, but is now generalized for arbitrary rectangular matrices, and with the default on Math:: RectangularMatrix being zero-fill while Math:: Matrix stays with the identity for consistency with other constructors. - Math::
Bezier:: data(), Math:: BitVector:: data(), Math:: Complex:: data(), Math:: CubicHermite:: data(), Math:: Dual:: data(), Math:: DualComplex:: data(), Math:: DualQuaternion:: data(), Math:: Frustum:: data(), Math:: Quaternion:: data(), Math:: Range:: data(), Math:: RectangularMatrix:: data() and Math:: Vector:: data() now return a reference to a fixed-size array instead of a pointer (i.e., T(&)[size]
instead ofT*
) for more convenient usage in APIs that take sized views. - Added Math::
Range:: scaled() and Math:: Range:: scaledFromCenter() overloads taking a scalar - Added a Math::
join(const Range<dimensions, T>&, const Vector<dimensions, T>&) overload for joining a range and a point
MeshTools library
- MeshTools::
interleavedLayout(const Trade:: MeshData&, UnsignedInt, Containers:: ArrayView<const Trade:: MeshAttributeData>, InterleaveFlags), MeshTools:: interleave(const Trade:: MeshData&, Containers:: ArrayView<const Trade:: MeshAttributeData>, InterleaveFlags) and MeshTools:: concatenate(const Containers:: Iterable<const Trade:: MeshData>&, InterleaveFlags) optionally take a MeshTools:: InterleaveFlags parameter affecting the output, in particular whether to preserve the original interleaved layout. - MeshTools::
interleaveInto() now returns the actually filled size - MeshTools::
concatenate() now allows concatenating an array attribute into an array attribute with more elements. The remaining elements are zero-filled, similarly to how missing attributes are handled. To avoid accidents and data loss, concatenating a bigger array into a smaller one isn't allowed. There's also a restriction that non-array attributes can't be concatenated into arrays, even though they would fit. - Support for new Trade::
MeshAttribute:: JointIds and Trade:: MeshAttribute:: Weights in MeshTools:: compile() as well as a new MeshTools:: compiledPerVertexJointCount() helper utility (see also mosra/ magnum#444) - MeshTools::
generateLineStripIndices(), generateLineLoopIndices(), generateTriangleStripIndices(), generateTriangleFanIndices() and generateIndices() now allow empty input, producing an empty index buffer as a result. Disallowing empty input was an unnecessary restriction that was inconsistent with other APIs. - MeshTools::
generateIndices() now generates a trivial index buffer for non-loop, non-strip and non-fan primitives, and if such a mesh is already indexed it simply passes it through - Added overloads to MeshTools::
generateLineStripIndices(), generateLineLoopIndices(), generateTriangleStripIndices() and generateTriangleFanIndices() that take an existing index buffer instead of vertex count as an input to generate an index buffer for a mesh that's already indexed.
Platform libraries
- Added a Platform::
GlfwApplication:: setWindowIcon() overload taking a Corrade:: Containers:: ArrayView in addition to std:: initializer_list - Platform::
GlfwApplication now properly uses EGL on GLES builds (see mosra/ magnum#470) - Platform::
GlfwApplication and Platform:: Sdl2Application can now work with EGL on desktop GL as well if MAGNUM_ TARGET_ EGL is enabled - On Emscripten, Platform::
EmscriptenApplication used an internal allocation function, which changed signature in 2.0.5 and caused runtime failures when -s ASSERTIONS
was enabled. A public stable API is now used instead, see mosra/magnum#483. - Not too long after the above, Emscripten 2.0.10 doesn't export
dynCall()
anymore, which caused Platform::EmscriptenApplication to fail at runtime with an error about dynCall()
not being defined. A workaround was put in place that usesdynCall()
internals, which should be present always. - Because hardcoding canvas size using Platform::
Application:: Configuration:: setSize() on WebGL is usually a wrong thing to do, both Platform:: EmscriptenApplication and Platform:: Sdl2Application now notify about that in the verbose output (enabled with ?magnum-log=verbose
), previously only autodetected canvas size got printed - Added Platform::
WindowlessIosContext:: glContext() for consistency with other context classes - Undefining even more noise from
Xlib.h
(see mosra/magnum#498) - Added Platform::
EmscriptenApplication:: Configuration:: addWindowFlags() and Platform:: EmscriptenApplication:: Configuration:: clearWindowFlags() for consistency with other application implementations - Added Platform::
Sdl2Application:: KeyEvent:: Key:: CapsLock, ScrollLock, NumLock, PrintScreen, Pause and Menu for consistency with Platform:: EmscriptenApplication and Platform:: GlfwApplication (see mosra/ magnum#547) - Platform::
Sdl2Application now overrides SDL's default behavior that prevents computer from entering a power-saving mode while the application is running, as that's generally undesirable for regular GUI applications. See Power management for more information. - Platform::
GlfwApplication now overrides GLFW's default behavior that changes current working directory to Resources/
in the app bundle on Apple platforms. - Platform::
EmscriptenApplication, Platform:: GlfwApplication and Platform:: Sdl2Application now explicitly query DPI scaling values each time they're accessed, either directly or via the viewport event, instead of always returning the initially queried / calculated value. This makes the behavior consistent with framebuffer and window sizes that are also queried every time, and fixes a case where changing global UI scaling would trigger a viewport event but the event would still have the previous UI scale. However note that this does not yet properly handle DPI change events themselves, which happen for example when moving windows across displays with different DPI. - Added more keys to Platform::
AbstractXApplication:: KeyEvent:: Key and implemented Platform:: AbstractXApplication:: scrollEvent() for better consistency with other application implementations - Added Platform::
Sdl2Application:: KeyEvent:: scanCode(), scanCodeName(), Platform:: GlfwApplication:: KeyEvent:: scanCode() and Platform:: EmscriptenApplication:: KeyEvent:: scanCodeName() for querying layout-independent key identifiers as well as Platform:: Sdl2Application:: scanCodeName(UnsignedInt), keyToScanCode(), scanCodeToKey() and Platform:: GlfwApplication:: keyToScanCode() helpers for key / scan code conversion outside of event handlers
SceneGraph library
- SceneGraph trees are now destructed in a way that preserves SceneGraph::
Object:: parent() links up to the root as well as SceneGraph:: AbstractFeature:: object() references - Added SceneGraph::
Object:: addFeature() as a counterpart to SceneGraph:: AbstractObject:: addFeature() that passes a concrete object type to the feature constructor, in order to make it work with for example the BulletIntegration:: MotionState
SceneTools library
- Added a
--bounds
option to magnum-sceneconverter, showing data ranges of known attributes - magnum-sceneconverter now has separate
--info-animations
,--info-images
,--info-lights
,--info-cameras
,--info-materials
,--info-meshes
,--info-skins
and--info-textures
for printing information just about particular data type, with--info
being a shortcut for all specified together - Added a
--object-hierarchy
option to magnum-sceneconverter that visualizes scene hierarchy in each scene by indenting object info - Added a
--prefer
option to magnum-sceneconverter, allowing to specify what plugins should be preferred for particular import and conversion plugin aliases - Added a
--set
option to magnum-sceneconverter, allowing to set configuration options to arbitrary plugins
Shaders library
- In the original implementation of normal mapping in Shaders::
PhongGL, there shader didn't provide a way to supply bitangent direction, forcing users to patch normal maps. This is now possible using newly added Shaders:: PhongGL:: Tangent4, Shaders:: PhongGL:: Bitangent attributes and a Shaders:: PhongGL:: Flag:: Bitangent flag, implementing support for both four-component tangents (used by glTF, for example) and separate tangent and bitangent direction (used by Assimp). - Added missing Shaders::
MeshVisualizerGL*D:: setObjectId() and a corresponding Shaders:: MeshVisualizerDrawUniform*D:: objectId member for UBO workflows. Originally the uniform wasn't present with the assumption that users could easily adjust color map offset to achieve the same effect. That was however unnecessarily annoying and error-prone in cases where it's essential to have the same object IDs from multiple draws have a matching color, and it was complicating multidraw workflows as the color map offset was not a part of per-draw data, but rather material data.
Text library
- Added Text::
AbstractFont:: glyphCount() and glyphSize() - Added Text::
Renderer:: fontSize() - Text::
Alignment now has separate values for alignment based on font metrics and cursor position alone, which is the more commonly expected behavior, and *GlyphBounds
values that align based on actual glyph bounds. There's a set of newBottom*
values that were for some reason missing before, and Text::Alignment:: TopCenterIntegral, which is also needed in order to prevent aligning pixel-perfect fonts to fractional positions. - Text::
Alignment gained special *Start
and*End
values for alignment based on text direction, and a new Text::alignmentForDirection() utility that resolves those to concrete *Left
and*Right
values based Text::LayoutDirection and Text:: ShapeDirection - Added a Text::
GlyphCacheGL:: GlyphCacheGL(NoCreateT) and Text:: DistanceFieldGlyphCacheGL:: DistanceFieldGlyphCacheGL(NoCreateT) constructor allowing to construct the object without a GL context present - New Text::
AbstractFont:: fillGlyphCache() overload taking a list of glyph IDs instead of a UTF-8 string to allow filling the glyph cache with glyphs that don't directly map to Unicode - New Text::
AbstractFont:: glyphName() and glyphForName() APIs for querying glyph names and retrieving IDs for particular glyph names. - Text::
AbstractFont:: fillGlyphCache() now returns a bool
to allow font plugin implementations to gracefully report failures
TextureTools library
- Added a TextureTools::
DistanceFieldGL:: DistanceFieldGL(NoCreateT) constructor allowing to construct the object without a GL context present
Trade library
- A changed signature of the Trade::
AbstractImporter:: doOpenData(Containers:: Array<char>&&, DataFlags) function and a new Trade:: DataFlag:: ExternallyOwned flag that allows importers to reason about ownership of passed data instead of being forced to allocate a local copy, saving as much as half memory in certain importer implementations - New Trade::
DataFlag:: Global flag to annotate data referencing global memory, such as Primitives:: cubeSolid() - Trade::
AbstractImageConverter:: doConvertToFile() and Trade:: AbstractSceneConverter:: doConvertToFile() are now protected
instead ofprivate
to allow calling them from plugin implementations and reuse the provided fallback to doConvertToData(), for example when the implementation only neeeds to do a format detection based on file extension - New Trade::
AbstractImageConverter:: extension() and mimeType() interfaces to get a file extension and MIME type corresponding to a file format produced by a particular plugin. - Recognizing BMP and TIFF file header magic in AnyImageImporter
- Recognizing ASTC and WebP files and data in AnyImageImporter
- Recognizing also a second variant of Radiance HDR file headers in AnyImageImporter (see mosra/
magnum#652) - Recognizing KTX2 files and data in AnyImageImporter and AnyImageConverter (see also mosra/
magnum#529) - Recognizing KTX2 for (compressed) 1D/2D/3D and multi-level 1D/2D/3D images in AnyImageConverter
- Recognizing WebP files in AnyImageConverter
- Recognizing glTF files in AnySceneConverter
- Recognizing 3MF files in AnySceneImporter
- Recognizing OpenVBD files in AnyImageImporter and AnyImageConverter
- AnyAudioImporter, AnyImageImporter, AnyImageConverter, AnySceneImporter, AnySceneConverter and AnyShaderConverter are now capable of propagating configuration options to the concrete plugin, which is useful mainly when using Image conversion utility and other utilities as you can now specify just the
-i
/-c
options without having to specify which plugin to apply the option to with-I
/-C
. For better usability, the plugins also warn if the user specifies and option that is not present in the target implementation. - AnyImageImporter and AnySceneImporter now can propagate also file callbacks to the concrete plugin.
- AnyImageConverter now implements also conversion of 3D and multi-level 2D/3D images for formats that support it (such as Basis Universal or OpenEXR)
- Added Trade::
PhongMaterialData:: hasCommonTextureTransformation(), Trade:: PhongMaterialData:: ambientTextureMatrix(), Trade:: PhongMaterialData:: diffuseTextureMatrix(), Trade:: PhongMaterialData:: specularTextureMatrix() and Trade:: PhongMaterialData:: normalTextureMatrix() exposing also per-texture coordinate transformation, similarly to per-texture coordinate sets added in 2020.06 - Added Trade::
PhongMaterialData:: hasCommonTextureCoordinates() and Trade:: PhongMaterialData:: commonTextureCoordinates() exposing a common texture coordinate set as a complement to a per-texture property added in 2020.06 - Trade::
MeshData now allows strided index buffers and zero and negative attribute strides for better data layout flexibility. This is however not commonly supported by GPU APIs and tools like MeshTools:: compile() assert in that case. - Trade::
MeshData now allows array attributes to have implementation-specific vertex formats as well. The restriction didn't make sense, as there was nothing in the design preventing them from being used. - Trade::
MeshData can now store morph target attributes next to the base attributes, they're then accessed using a concrete morph target ID in name-based lookup APIs - Added Trade::
MeshData:: findAttributeId() for an ability to check that an attribute exists and retrieve its ID in a single step, avoiding a double lookup compared to hasAttribute() + attributeId(). This also makes the API consistent with Trade:: SceneData:: findFieldId(). - Added Trade::
MeshData:: attributeId() that returns ID of an attribute in a set of attributes of the same name - Added Trade::
TextureType:: Texture1DArray, Texture2DArray and CubeMapArray in order to be able to distinguish what's the intended texture use, e.g. whether it's a 3D texture with filtering along Z or if it's a 2D array with discrete slices. - TgaImporter now recognizes and skips TGA 2 file footers instead of treating them as actual image data
- TgaImageConverter now implements RLE for smaller output size
- magnum-imageconverter has a new
--in-place
option for converting images in-place - In order to reduce the amount of exported symbols, a single no-op Containers::
Array deleter function was used for various types via a reinterpret_cast
. But in an effort to be UBSan-clean, this is no longer done. See also mosra/magnum#531.
Build system
- The oldest supported Clang version is now 6.0 (available on Ubuntu 18.04), or equivalently Apple Clang 10.0 (Xcode 10). Oldest supported GCC version is still 4.8.
- Fixed compilation of the GL library on macOS with ANGLE — new code assumed macOS is always desktop GL (see mosra/
magnum#452) - Avoiding conflicts of Magnum's own GL headers with
GLES3/gl32.h
(see mosra/magnum#460) - The
version.h
header now gets populated from Git correctly also when inside a CMake subproject - Suppressed a warning specific to MinGW GCC 8+ (see mosra/
magnum#474) - Attempted a switch of Emscripten build on Travis CI from macOS to Ubuntu + Docker for 2x faster build times in a futile attempt to not use the extremely expensive features of a no-longer-free service. Ultimately, Travis banned everyone from using their CI and so all Linux, macOS, Emscripten, Android and iOS builds were migrated from Travis to Circle CI, together with adding also an explicit ARM64 build and an ability to test GLES and Vulkan functionality on Android. See mosra/
magnum#350 and mosra/ magnum#523. UseEmscripten
is no longer implicitly included on Emscripten as it's not needed for anything (see mosra/magnum#490) - Fixed an assertion in AnySceneImporter when meshAttributeName() or meshAttributeForName() was called without a file opened
- ObjImporter uses exceptions internally and needs an explicit exception-enabling flag when built with Emscripten 1.39.0 and newer
- It's now possible to use
<PackageName>_ROOT
to point to install locations of dependencies such as Corrade on CMake 3.12+, in addition to putting them all together insideCMAKE_PREFIX_PATH
. See also mosra/magnum#614. - On CMake 3.16 and newer,
FindMagnum.cmake
can provide additional details if some component is not found. - The Homebrew package now uses
std_cmake_args
instead of hardcoded build type and install prefix, which resolves certain build issues (see mosra/homebrew-magnum#6) - Various changes to Vcpkg packages to account for newly added libraries and plugin interfaces (mosra/
magnum#485) - The
FindSDL2.cmake
module was updated to allow using SDL2 as a subproject. See the Platform::Sdl2Application docs for more information. See also mosra/ magnum#496. - With CMake 3.20 and newer it's possible to compile for Android NDK r19+ without explicitly supplying various system paths. Additionally, when
CMAKE_INSTALL_PREFIX
points to Android NDK sysroot, theLIB_SUFFIX
gets autodetected to a correct triplet + API level version subdirectory, making the installed project discoverable by both vanilla CMake and Gradle. On CMake 3.16 to 3.19 it's required to set two extra variables for the same effect. See Cross-compiling for Android, Android and mosra/magnum#310 for more information. - Suppressing a CMake policy-related warning if the global
CMAKE_AUTOMOC
is set on CMake 3.10+ (see mosra/magnum#504) - Updated Debian build instructions to pass
--no-sign
todpkg-buildpackage
, avoiding a confusing error message that might lead people to think the packaging failed (see mosra/magnum-plugins#105) - Due to STL removal in Corrade::
PluginManager, deprecated APIs in Trade library that use std:: string stopped compiling on MSVC as there was no remaining transitive #include <string>
left (see mosra/magnum#556) - Changed handling of
CMAKE_*_OUTPUT_DIRECTORY
to make plugins pick it up also if only e.g.CMAKE_RUNTIME_OUTPUT_DIRECTORY
is set, but notARCHIVE
orLIBRARY_OUTPUT_DIRECTORY
. Similarly it now also handles config-specificCMAKE_*_OUTPUT_DIRECTORY_<CONFIG>
variables. See mosra/magnum#486 and mosra/ magnum#570. - Fixed wrong
.gitattributes
option for LF line endings in MSYS PKGBUILDs (see mosra/magnum#574) - Added
MAGNUM_DISTANCEFIELDCONVERTER_STATIC_PLUGINS
,MAGNUM_FONTCONVERTER_STATIC_PLUGINS
,MAGNUM_IMAGECONVERTER_STATIC_PLUGINS
,MAGNUM_SCENECONVERTER_STATIC_PLUGINS
andMAGNUM_SHADERCONVERTER_STATIC_PLUGINS
CMake options for linking static plugins to the command-line utilities. See Enabling or disabling features for more information. - The
FindSDL2.cmake
module now looks forSDL2-static
andSDL2-staticd
as well (see mosra/magnum#594 and mosra/ magnum#613) - Fixed a typo in a CMake option name (see mosra/
magnum#599) - Worked around a MSVC2022 bug with constexpr conversion operators if C++20 is used, causing most Math tests to fail compilation (see mosra/
magnum#602) - Fixed various variable shadowing warings on MSVC (see mosra/
magnum#611) - Fixed compilation on a non-deprecated build (see mosra/
magnum#612) - Fixed build of the Vk library with CORRADE_
STANDARD_ ASSERT - On Windows there's a new
MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS_DLL_NAME
CMake option to aid MAGNUM_BUILD_ STATIC_ UNIQUE_ GLOBALS in cases where Corrade is only linked to a DLL but not the main executable. - It's now possible to build dynamic libraries on Android and Emscripten with the usual options. Static libraries are still a default but it isn't enforced anymore. See mosra/
magnum#617. - The Emscripten toolchain now prefers include directory located in the Emscripten cache, which as of Emscripten 3.0.4 contains the
version.h
header. See mosra/corrade#133 and also Including files directly from the emscripten source tree is not supported for troubleshooting info. - The Emscripten toolchain now uses the
-flto
flag instead of--llvm-lto
, which was specific to the fastcomp backend that's removed as of Emscripten 2.0, and sets up correctemar
to be used for LTO. See mosra/toolchains#13, mosra/ toolchains#14 and mosra/ magnum#490. - The Emscripten toolchain now looks for
lib*.a
files in addition to*.bc
for better compatibility with 3rd party toolchains and package managers like Vcpkg (see mosra/magnum#520). - The Emscripten build now uses
--js-library
instead of inlineEM_ASM()
for calling into JavaScript. This allows it to properly specify its runtime dependencies without risking breakages when new Emscripten versions make more JS API functions optional, and circumvents the need for users to specify-s EXPORTED_FUNCTIONS
on their side. See mosra/magnum#619. - Fixed build of Platform::
EmscriptenApplication on Emscripten 3.1.49 and newer (see mosra/ magnum#631), and on Emscripten 3.1.62 and newer (see mosra/ magnum#641) - The Emscripten toolchain no longer uses a
*.bc
extension for static libraries, as that breaks builds with version 3.1.52+. See mosra/magnum#633 for more information. - Fixed most remaining warnings on MSVC, in particular those related to "conversion from T to void * of greater size" (see mosra/
magnum#544). - The
android_create_apk()
CMake function gained an ability to copy resources and assets to the APK. See the corresponding Android platform documentation and mosra/toolchains#10 for more information - Magnum now automatically installs and uses Find modules for its dependencies in a way that doesn't clash with modules of the same name potentially installed by other software, meaning the user doesn't need to copy and carry them along anymore (see mosra/
magnum#436) - The
FindSDL2.cmake
module now delegates to SDL's own CMake config file, if available, especially to ensure all dependencies are correctly linked on static builds (see mosra/magnum#553) - Created a RPM package with a helper script for building (see mosra/
magnum#537 and mosra/ magnum#650)
Bug fixes
- The state tracker didn't correctly recognize the "base" / "range" GL::
Buffer:: bind() call as affecting also the regular binding point, leading to wrong buffer object being used for data upload etc. in certain cases on platforms without DSA extensions. - A large refactor of GL::
Mesh internals caused VAOs to no longer be correctly deleted on destruction (see mosra/ magnum#632) - GL::
Context move constructor was not marked noexcept
by accident and it was also not really moving everything properly, especially when delayed creation was done on the moved-to object - GL::
OpenGLTester:: addBenchmarks() taking a setup/teardown function passed the arguments to the base TestSuite:: Tester implementation in a wrong order, failing to compile if this function was used in a test - Destructing a moved-out GL::
Mesh was querying the GL context to decide what to destroy in its internal state, now it's a proper no-op that works also with the GL context already gone, like with all other GL object wrappers. - GL::
Renderer:: MemoryBarrier:: ShaderStorage had an incorrect value - GL::
Shader limit queries for a particular shader stage on desktop were out-of-bounds array accesses, causing wrong or random values being returned for most shader-related limits - Fixed GL::
Shader reporting errors and warnings with line numbers off-by-one on desktop GLSL < 330. - Fixed accidentally incorrect GL::
textureFormat() mapping for PixelFormat:: RG8Snorm, RGB8Snorm, RGBA8Snorm and RGB32UI - Fixed assertions related to OpenGL driver workarounds when the proprietary AMDGPU PRO drivers are used on Linux
- Fixed Utility::
Tweakable parsers to compile with negative Math:: Deg / Math:: Rad literals such as _(-15.0_degf)
- Fixed a silly mistake where there was no
extern template
for a Frustumd debug printer but two declarations for the float version instead (see mosra/magnum#545) - Fixed the QuadraticBezier2Dd, QuadraticBezier3Dd, CubicBezier2Dd and CubicBezier3Dd typedefs to be actually double-precision
- The Math::
Matrix4:: normalMatrix() utility was introduced in version 2019.10 based on an article claiming that it's "[a faster calculation of the normal matrix that behaves correctly also in presence of reflections](https://github.com/graphitemaster/normals_revisited)". Such claim was true only in case the normals were calculated on-the-fly from vertices in a winding order wrongly flipped due to the reflection, effectively undoing the original calculation error. As practical uses in Magnum always involve normals precalculated on an untransformed mesh and passed to the shader via a vertex attribute, this method gave an incorrect result while the classic inverse transpose did the right thing. The function is kept since there's a value in having a convenience API instead of typing out (and having to read / teach / explain / decipher) transformation.rotationScaling().inverted().transposed()
every time, it's just corrected to return an inverse transpose instead of a Math::Matrix:: cofactor() of the upper 3x3 matrix. - Fixed an assertion when using MeshTools::
removeDuplicates() on an interleaved Trade:: MeshData that included padding at the beginning or end of each vertex - Fixed MeshTools::
compile() to properly take into account index buffer offsets - Fixed MeshTools::
removeDuplicates() to not take into account random padding bytes and filtered-out attributes in interleaved source Trade:: MeshData. This was a particularly glaring issue when using magnum-sceneconverter with both --only-attributes
and--remove-duplicates
specified together, where it usually just didn't remove any duplicate whatsoever while--remove-duplicates-fuzzy
did, no matter how ridiculously low epsilon was used. - Fixed MeshTools::
generateIndices() to work correctly with attribute-less Trade:: MeshData instances - Platform::
EmscriptenApplication randomly created antialiased contexts due to an uninitialized variable in its GLConfiguration - Creating Platform::
WindowlessEglApplication again after it was destroyed could fail with an error saying "cannot make the previous context current" on certain system. This was due to EGL not destroying the context if it's still made current. - Fixed handling of Platform::
Sdl2Application:: InputEvent:: Modifier:: Super, which was misreported as Alt (see mosra/ magnum#547) - For meshes with multiple sets of vertex attributes (such as texture coordinates), MeshTools::
compile() should be using only the first set but it wasn't. - Shaders::
MeshVisualizerGL*D shader compilation failed on OpenGL ES 3.2 with missing gl_PrimitiveID
due to GLSL ES 3.20 not being properly used for the#version
directive - Shaders::
MeshVisualizerGL3D vertex ID visualization didn't work when enabled together with TBN visualization - Shaders::
PhongGL was normalizing light direction in vertex shader, causing the fragment-interpolated direction being incorrect with visible artifacts on long polygons under low light angle - Shaders::
PhongGL wasn't normalizing normals coming from normal textures, which may have caused slight artifacts due to limited precision of 8-bit pixel formats - The default Shaders::
PhongGL light range value embedded in the shader was interpreted as NaN instead of an infinity on NVidia, causing completely black output unless Shaders:: PhongGL:: setLightRange() was explicitly called to overwrite it with a runtime-specified value (see mosra/ magnum#446) - Text::
AbstractFontConverter:: exportFontToData() and Text:: AbstractFontConverter:: exportGlyphCacheToData() didn't correctly propagate errors when delegating to Text:: AbstractFontConverter:: exportFontToSingleData() / Text:: AbstractFontConverter:: exportGlyphCacheToSingleData() - TextureTools::
DistanceFieldGL no longer generates an output that's slightly shifted, which also makes the output invariant to flips and transpositions - Trade::
MeshData:: attributeData(UnsignedInt) const was not correctly propagating attribute array size, causing array attributes to appear as non-array - Trade::
MeshData constructor data view range assertions weren't correctly taking sizes of array attributes into account, leading to meshes with out-of-range attributes getting silently accepted - Fixed Platform::
GlfwApplication, Platform:: Sdl2Application and Platform:: EmscriptenApplication to correctly print app-specified DPI scaling in its verbose output - Fixed canvas size setup in Platform::
EmscriptenApplication to be the same in the Contextless case as for a WebGL-enabled context - Fixed a crash in Platform::
GlfwApplication:: setCursor() on the upcoming GLFW 3.4 - Fixed Platform::
Sdl2Application:: setSwapInterval() to take late swap behavior ( -1
) into account instead of treating it as an error and continuing with timer-based framerate capping - SceneGraph::
BasicMatrixTransformation2D, SceneGraph:: BasicMatrixTransformation3D, SceneGraph:: BasicRigidMatrixTransformation2D and SceneGraph:: BasicRigidMatrixTransformation3D were broken in the Double variant. To prevent such cases from happening in the future, the whole library is now tested for both floats and doubles. - Fixed magnum-fontconverter to properly hook up image converter plugin manager for cross-manager dependencies, broken since the removal of global shared manager state in 2020.06 (see mosra/
magnum#489) - Implementation of the
"nv-egl-incorrect-gl11-function-pointers"
OpenGL workaround could lead to a crash ifeglQueryString()
would return anullptr
(see mosra/magnum#535) - Fixed various wrong assumptions about Mac builds being always desktop GLES (see mosra/
magnum#) - Fixed the
"firefox-fake-disjoint-timer-query-webgl2"
workaround to work on Firefox again. The reported renderer string got changed, possibly in relation to WEBGL_debug_ renderer_ info being deprecated, which broke Firefox detection in the workaround enabling code. - Platform::
EmscriptenApplication was emitting only a text input event if text input was active, not a key press event as well, making it impossible to handle keyboard shortcuts such as copy / paste when editing text. Now it emits both, consistently with Platform:: Sdl2Application and Platform:: GlfwApplication, and in the same order as in those. See mosra/ magnum#637. - Fixed swapped middle and right buttons in Platform::
EmscriptenApplication:: MouseMoveEvent, caused by the JavaScript events themselves having an unexplainable inconsistency in button numbering
Deprecated APIs
- The (mutually exclusive)
MAGNUM_TARGET_HEADLESS
andMAGNUM_TARGET_DESKTOP_GLES
options, CMake variables and preprocessor variables are deprecated in favor of MAGNUM_TARGET_ EGL. It's enabled by default on GLES and disabled by default on desktop GL — disabling it on GLES will force creation of a GLES context using the GLX / WGL libraries (if available); enabling it on desktop GL will allow running windowless applications on headless machines. - The
MAGNUM_TARGET_GLES3
CMake and preprocessor variable existed solely in anticipation of there eventually being OpenGL ES 4.0. That is increasingly unlikely to happen and most of the internal code treated it as a simple inverse of MAGNUM_TARGET_ GLES2, thus it's deprecated in favor of that. - All CMake build options are now prefixed with
MAGNUM_
. For backwards compatibility, unless MAGNUM_BUILD_ DEPRECATED is disabled and unless a prefixed option is already set during the initial run, the unprefixed options are still recognized with a warning. In particular, if BUILD_DEPRECATED
is set butMAGNUM_BUILD_DEPRECATED
not, the unprefixed options are also recognized. See also mosra/corrade#139. - GL::
DebugOutput:: setCallback() taking a std:: string in the callback function pointer is deprecated in favor of a version taking a Containers:: StringView. See also mosra/ magnum#499 and mosra/ magnum#596. GL::MeshView::setIndexRange()
is deprecated in favor of GL::MeshView:: setIndexOffset() that has a much less confusing name GL::Mesh::indexTypeSize()
is deprecated in favor of a standalone GL::meshIndexTypeSize() utility that you can call on the enum returned from GL:: Mesh:: indexType() - The
Array
,Array1D
,Array2D
andArray3D
types that were used exclusively for specifying SamplerWrapping in various texture APIs are deprecated in favor of Math::Vector and its subclasses and all existing APIs were switched to it. The only advantage of this type compared to Math:: Vector was that it provided an implicit constructor from a single value (whereas Math:: Vector has it explicit
), and that's now solved by simply providing an overload with just a single value where it matters. It was also commonly confused with Containers::Array, which is a type with totally different semantics. To avoid breaking existing code, conversion from and to Math:: Vector is now provided and this type is included in all places where it was originally used. For custom uses, the Containers:: Array1, Containers:: Array2 or Containers:: Array3 types provide a suitable alternative as well. - The
Math::BoolVector
class and theBoolVector2
,BoolVector3
andBoolVector4
typedefs are deprecated in favor of Math::BitVector, BitVector2, BitVector3 and BitVector4 to not imply storing the 8-bit bool
type and for consistency with the new Containers::BitArray types Math::Color3::fromSrgb()
,Math::Color4::fromSrgb()
andMath::Color4::fromSrgbAlpha()
taking a 32-bit integer are deprecated in favor of Math::Color3:: fromSrgbInt(), Math:: Color4:: fromSrgbInt() and Math:: Color4:: fromSrgbAlphaInt() for consistency with toSrgbInt() and toSrgbAlphaInt() and to prevent accidental type mismatches Math::angle(const Quaternion<T>&, const Quaternion<T>&)
historically returned a half-angle instead of the full angle, which is incorrect. Because fixing it would break all current uses of it, it's deprecated in favor of Math::halfAngle(const Quaternion<T>&, const Quaternion<T>&), which returns the same value but is named appropriately. This function will get reintroduced with a correct output after enough time passes to avoid breaking existing code. - Markup styling for Emscripten application was switched to prefer using CSS classes instead of the
#container
,#sizer
,#expander
,#listener
,#canvas
,#log
,#status
and#status-description
IDs as this enables having more than one application on the page. Styling still supports the IDs for backwards compatibility, from now the IDs are only required in order to reference the canvas and status elements from the JSModule
. See Building and deploying graphical apps and mosra/magnum#481 for details. pixelSize()
,GL::pixelSize()
,compressedBlockSize()
andcompressedBlockDataSize()
is deprecated in favor of pixelFormatSize(), GL::pixelFormatSize(), compressedPixelFormatBlockSize() and compressedPixelFormatBlockDataSize() for consistency with similar APIs for VertexFormat and other format enums - Templated variants of DebugTools::
bufferData() and DebugTools:: bufferSubData() are deprecated in favor of the non-templated API together with Containers:: arrayCast(). A similar change was done for GL:: Buffer:: data() in 2017 already, unfortunately this helper was missed. DebugTools::GLFrameProfiler
is deprecated in favor of DebugTools::FrameProfilerGL. The new name plays better with IDE autocompletion and makes the GL-specific class appear next to the API-independent base in alphabetically sorted lists. - List-taking
GL::Shader::compile()
andGL::AbstractShaderProgram::link()
functions are deprecated in favor of new GL::Shader:: submitCompile(), checkCompile(), GL:: AbstractShaderProgram:: submitLink() and checkLink() APIs. These were originally meant to make use of parallel shader compilation, but in practice that meant compiling at most two or three shaders at once. The new API allows for much larger parallelism as well as an ability to query completion status. MeshTools::owned()
was deprecated in favor of a more clearly named MeshTools::copy() utility living in a new Magnum/ MeshTools/ Copy.h header. To avoid having too many little headers, MeshTools:: reference() and MeshTools:: mutableReference() were moved there as well, with Magnum/MeshTools/Reference.h
being a deprecated alias now.Platform::EmscriptenApplication::GLConfiguration::Flag::PreferLowPowerToHighPerformance
is deprecated as it didn't allow explicitly choosing between high performance and a default, use Flag::PowerPreferenceLowPower or Flag:: PowerPreferenceHighPerformance instead Platform::Sdl2Application::setMinimalLoopPeriod(UnsignedInt)
taking an untyped millisecond value is deprecated in favor of setMinimalLoopPeriod(Nanoseconds)Platform::Sdl2Application::mousePressEvent()
,mouseReleaseEvent()
,mouseMoveEvent()
,mouseScrollEvent()
,MouseEvent
.MouseMoveEvent
andMouseScrollEvent
are deprecated in favor of new Platform::Sdl2Application:: pointerPressEvent(), pointerReleaseEvent(), pointerMoveEvent(), scrollEvent(), PointerEvent, PointerMoveEvent and ScrollEvent APIs that provide a better abstraction over general pointer input, not just a mouse alone. The same change is done in Platform:: AbstractXApplication, Platform:: AndroidApplication, Platform:: EmscriptenApplication, Platform:: GlfwApplication and the Platform:: BasicScreenedApplication / Platform:: BasicScreen wrappers as well. Platform::Sdl2Application::multiGestureEvent()
and theMultiGestureEvent
event class is deprecated in favor of a new Platform::TwoFingerGesture helper. The SDL event reported relative distance to previous finger positions instead of a relative diameter between multiple pressed fingers, making it practically useless for implementing pinch zoom. It additionally reported everything in normalized coordinates, thus the distance and rotation was only meaningful when the window was an exact square. Platform::Sdl2Application::InputEvent::Modifier
,Modifiers
andPlatform::Sdl2Application::KeyEvent::Key
enums and thePlatform::Sdl2Application::KeyEvent::keyName(Key)
function are deprecated in favor of Platform::Sdl2Application:: Modifier, Modifiers, Key and keyName() APIs contained directly in the application class. Besides the obvious advantage of them being shorter to type, this allows the enums to be used outside of the event class scope. The same change is done in Platform:: AbstractXApplication, Platform:: EmscriptenApplication and Platform:: GlfwApplication. Platform::AbstractXApplication::MouseEvent::Button::WheelUp
andWheelDown
members are deprecated in favor of a dedicated Platform::AbstractXApplication:: scrollEvent(). Similar change was done for all other application classes in 2016 already. Shaders::DistanceFieldVector
,Shaders::Flat
,Shaders::Generic
,Shaders::MeshVisualizer2D
,Shaders::MeshVisualizer3D
,Shaders::Phong
,Shaders::Vector
,Shaders::VertexColor
and related 2D/3D typedefs are deprecated in favor of Shaders::DistanceFieldVectorGL, Shaders:: FlatGL, Shaders:: GenericGL, Shaders:: MeshVisualizerGL2D, Shaders:: MeshVisualizerGL3D, Shaders:: PhongGL, Shaders:: VectorGL, Shaders:: VertexColorGL and correspondingly renamed typedefs to make room for Vulkan shaders and functionality shared between OpenGL and Vulkan implementation such as uniform buffer layout definitions - Shaders class constructors taking flags and other parameters directly are deprecated in favor of constructors taking a configuration instance such as Shaders::
FlatGL:: FlatGL(const Configuration&) for better extensibility - Shaders::
PhongGL:: setLightPositions() and Shaders:: PhongGL:: setLightPosition() taking three-component vectors are deprecated in favor of variants taking four-component vectors, where the last component distinguishes between directional and point lights Shaders::PhongGL::setLightPosition(const Vector3&)
is deprecated in favor of Shaders::PhongGL:: setLightPositions() with a single item — it's short enough to not warrant the existence of a dedicated overload - Shaders::
PhongGL:: setLightColors() and Shaders:: PhongGL:: setLightColor() taking four-component colors are deprecated in favor of variants taking just three-component colors, as the alpha had no meaningful use anyway. Shaders::PhongGL::setLightColor(const Magnum::Color4&)
is deprecated in favor of Shaders::PhongGL:: setLightColors() with a single item — it's short enough to not warrant the existence of a dedicated overload - The Text library API was reworked for more features, better efficiency and no dependencies on the STL:
Text::AbstractFont::layout()
and theText::AbstractLayouter
class is deprecated in favor of Text::AbstractFont:: createShaper() and the Text:: AbstractShaper class, which allows for reusing allocated resources, is independent on a glyph cache and has a batch-oriented interface for retrieving shaped glyph data Text::GlyphCacheFeature::ImageDownload
is deprecated in favor of Text::GlyphCacheFeature:: ProcessedImageDownload, as there's now a possibility to get the image directly for glyph caches that don't have Text:: GlyphCacheFeature:: ImageProcessing - The
Text::AbstractGlyphCache::AbstractGlyphCache(const Vector2i&, const Vector2i&)
constructor is deprecated in favor of Text::AbstractGlyphCache:: AbstractGlyphCache(PixelFormat, const Vector2i&, const Vector2i&) that specifies a concrete format for the cache image. - The
Text::AbstractGlyphCache::reserve()
function is deprecated in favor of operating directly on a TextureTools::AtlasLandfill instance through Text:: AbstractGlyphCache:: atlas(). It also forced the caller to use a std:: vector, which wasn't nice at all. The old API can only be called on 2D glyph caches now, and only when there's no font added yet. Text::AbstractGlyphCache::insert()
function is deprecated in favor of Text::AbstractGlyphCache:: addFont() and addGlyph() that better expose multi-font and 2D array support. The old API can only be called on 2D glyph caches now. Text::AbstractGlyphCache::textureSize()
is deprecated in favor of Text::AbstractGlyphCache:: size() which returns a 3D size in order to support texture arrays as well. The old API can only be called on 2D glyph caches now. Text::AbstractGlyphCache::setImage()
is deprecated, copy glyph data to slices of Text::AbstractGlyphCache:: image() instead and call flushImage() instead. The old API can only be called on 2D glyph caches now. Text::DistanceFieldGlyphCacheGL::distanceFieldTextureSize()
andsetDistanceFieldImage()
is deprecated in favor of Text::AbstractGlyphCache:: processedSize() and setProcessedImage() - Text::
GlyphCacheGL constructors taking either a GL:: TextureFormat or no texture / pixel format at all are deprecated in favor of constructors taking an explicit PixelFormat. The internal texture format is now considered an implementation detail.
- The
TextureTools::atlas()
utility is deprecated in favor of TextureTools::AtlasLandfill, which has a vastly better packing efficiency, supports incremental packing and doesn't force the caller to use a std:: vector - The
Text::GlyphCache
,Text::DistanceFieldGlyphCache
andTextureTools::DistanceField
classes are deprecated in favor of Text::GlyphCacheGL, Text:: DistanceFieldGlyphCacheGL and TextureTools:: DistanceFieldGL along with correspondingly renamed headers, to make room for implementations with other backends such as Vulkan Trade::AbstractMaterialData
as well as its containing headerMagnum/Trade/AbstractMaterialData.h
is now a deprecated alias to the new and more flexible Trade::MaterialData. - Trade::
AnimationTrackData constructors taking Animation:: TrackViewStorage are deprecated in favor of significantly less verbose variants that take key/value views and other track parameters directly, allowing them to either directly deduce the value type or be truly type-erased, no longer requiring user code to manually handle all possible cases. The variant taking an Animation:: TrackView is kept however as it may be convenient when exporting already-populated animation instances. Trade::LightData::Type
is deprecated in favor of Trade::LightType that is shorter to type and can be forward-declared Trade::LightType::Infinite
, originally adapted from the OpenGEX specification, is deprecated in favor of Trade::LightType:: Directional as that's the more commonly used term Trade::PhongMaterialData::ambientCoordinateSet()
,diffuseCoordinateSet()
,specularCoordinateSet()
andnormalCoordinateSet()
are deprecated in favor of more consistently named Trade::PhongMaterialData:: ambientTextureCoordinates(), diffuseTextureCoordinates(), specularTextureCoordinates() and normalTextureCoordinates() - Trade::
PhongMaterialData constructor is deprecated as the designated way is to populate the Trade:: MaterialData class directly instead. Trade::PhongMaterialData::textureMatrix()
is deprecated in favor of Trade::PhongMaterialData:: hasCommonTextureTransformation() and Trade:: PhongMaterialData:: commonTextureMatrix(), which do proper checking and fallback in case a per-texture transformation is present Trade::MaterialData::type()
(coming from the originalAbstractMaterialData
class) is deprecated in favor of Trade::MaterialData:: types(), as a material data can now contain attributes for multiple different material types at once Trade::MaterialData::flags()
(coming from the originalAbstractMaterialData
class),Trade::PhongMaterialData::flags()
and related enum (sets) are deprecated. The flags are no longer stored directly but rather generated on-the-fly from attribute data, which makes them less efficient than calling Trade::MaterialData:: hasAttribute() etc. - Trade::
SceneData constructor taking a std:: vector of 2D and 3D children is deprecated in favor of the new scene representation. Use Trade:: SceneData:: SceneData(SceneMappingType, UnsignedLong, Containers:: Array<char>&&, Containers:: Array<SceneFieldData>&&, const void*) instead. Trade::SceneData::children2D()
andTrade::SceneData::children3D()
are deprecated in favor of the new scene representation. Use Trade::SceneData:: childrenFor() with -1
passed as theobject
argument to get a list of top-level objects.Trade::ObjectData*D
,Trade::MeshObjectData*D
classes,Trade::ObjectInstanceType*D
,Trade::ObjectFlag*D
,Trade::ObjectFlags*D
enums and the correspondingTrade::AbstractImporter::object*DCount()
,Trade::AbstractImporter::object*DForName()
,Trade::AbstractImporter::object*DName()
andTrade::AbstractImporter::object*D()
accessor APIs are deprecated in favor of the unified representation in Trade::SceneData and the Trade:: AbstractImporter:: objectCount(), objectForName() and objectName() accessors that are shared for 2D and 3D. - Trade::
AbstractImporter:: material() now returns Corrade:: Containers:: Optional instead of a Corrade:: Containers:: Pointer, as the new Trade:: MaterialData class isn't polymorphic anymore. If MAGNUM_ BUILD_ DEPRECATED is enabled, the returned type acts as a Corrade:: Containers:: Optional but has (deprecated) implicit conversion to a Corrade:: Containers:: Pointer to avoid breaking user code. - All Platform APIs that used to take or return a std::
string are ported to use Containers:: StringView or Containers:: String instead. If MAGNUM_ BUILD_ DEPRECATED is enabled, implicit conversion from and to a std:: string is provided by including the Corrade/ Containers/ StringStl.h header. Include it explicitly in your code if you want to keep using a std:: string. See also mosra/ magnum#559. - All Trade::
AbstractImporter APIs that used to take or return a std:: string are ported to use Containers:: StringView or Containers:: String instead. If MAGNUM_ BUILD_ DEPRECATED is enabled, implicit conversion from and to a std:: string is provided by including the Corrade/ Containers/ StringStl.h header. Include it explicitly in your code if you want to keep using a std:: string. - Trade::
AbstractImporter:: doOpenData() taking an array view is deprecated in favor of the more flexible signature that takes a r-value Containers:: Array Trade::ImageConverterFeature::ConvertImage
andTrade::ImageConverterFeature::ConvertCompressedImage
;Trade::AbstractImageConverter::exportToImage()
andTrade::AbstractImageConverter::exportToCompressedImage()
are deprecated in favor of an unifying Trade::ImageConverterFeature:: Convert2D and a corresponding Trade:: AbstractImageConverter:: convert() that returns an Trade:: ImageData2D and thus can handle both cases and follows a naming scheme used elsewhere Trade::ImageConverterFeature::ConvertFile
,Trade::ImageConverterFeature::ConvertCompressedFile
,Trade::ImageConverterFeature::ConvertData
andTrade::ImageConverterFeature::ConvertCompressedData
are deprecated in favor of Trade::ImageConverterFeature:: Convert2DToFile, Trade:: ImageConverterFeature:: ConvertCompressed2DToFile, Trade:: ImageConverterFeature:: Convert2DToData and Trade:: ImageConverterFeature:: ConvertCompressed2DToData that more clearly imply what's converted to what and make room for 3D image conversion as well Trade::AbstractImageConverter::exportToData()
andTrade::AbstractImageConverter::exportToFile()
are deprecated in favor of Trade::AbstractImageConverter:: convertToData() and Trade:: AbstractImageConverter:: convertToFile() that follow a naming scheme used elsewhere - The signature of Trade::
AbstractSceneConverter:: convertToFile() was changed to have input first and output second, for consistency with other interfaces, together with a switch to Containers:: StringView. The original signature is marked as deprecated. - The
Trade::AnimationTrackTargetType
enum andTrade::AnimationData::trackTargetType()
is deprecated in favor of a shorter and less confusing Trade::AnimationTrackTarget and Trade:: AnimationData:: trackTargetName() - Due to introduction of ImageFlags, Trade::
ImageData constructors that were taking const void* importerState
as the last parameter are now deprecated in favor of constructors that take ImageFlags andimporterState
. Code that wasn't passing theimporterState
parameter isn't affected by this change. Trade::TextureData::Type
was deprecated in favor of Trade::TextureType that is much less annoying to type, in addition Trade::TextureData::Type::Cube
was deprecated in favor of Trade::TextureType:: CubeMap for consistency. Vk::hasVkFormat(Magnum::VertexFormat)
,Vk::hasVkFormat(Magnum::PixelFormat)
,Vk::hasVkFormat(Magnum::CompressedPixelFormat)
,Vk::vkFormat(Magnum::VertexFormat)
,Vk::vkFormat(Magnum::PixelFormat)
andVk::vkFormat(Magnum::CompressedPixelFormat)
returning a raw VkFormat are deprecated in favor of Vk::hasVertexFormat(), Vk:: hasPixelFormat(Magnum:: PixelFormat), Vk:: hasPixelFormat(Magnum:: CompressedPixelFormat), Vk:: vertexFormat(), Vk:: pixelFormat(Magnum:: PixelFormat) and Vk:: pixelFormat(Magnum:: CompressedPixelFormat) that return the new Vk:: PixelFormat enum that contains only values suitable for a pixel format Vk::hasVkIndexType()
andVk::vkIndexType()
returning a raw VkIndexType are deprecated in favor of Vk::meshIndexType() that returns the new Vk:: MeshIndexType enum. Since all generic index types are available in Vulkan now, there's no need for a hasMeshIndexType()
anymore.Vk::hasVkPrimitiveTopology()
andVk::vkPrimitiveTopology()
returning a raw VkPrimitiveToplogy are deprecated in favor of Vk::hasMeshPrimitive() and Vk:: meshPrimitive() that return the new Vk:: MeshPrimitive enum
Potential compatibility breakages, removed APIs
- Removed remaining APIs deprecated in version 2018.10, in particular:
Audio::PlayableGroup::setClean()
, use Audio::Listener:: update() instead GL::*Texture::setSRGBDecode()
,GL::Renderer::Feature::FramebufferSRGB
,Platform::*Application::GLConfiguration::setSRGBCapable()
andPlatform::*Application::GLConfiguration::isSRGBCapable()
, use GL::*Texture:: setSrgbDecode(), GL:: Renderer:: Feature:: FramebufferSrgb, Platform:: *Application:: GLConfiguration:: setSrgbCapable() and Platform:: *Application:: GLConfiguration:: isSrgbCapable() instead Math::Geometry
,Math::Geometry::Distance
andMath::Geometry::Intersection
namespaces, use Math::Distance and Math:: Intersection instead - Math::
Intersection:: planeLine() taking a separate plane normal and position, use Math:: planeEquation() instead - MeshTools::
compile() taking a GL:: BufferUsage and returning a tuple, use the simpler versions instead (note that the Trade::MeshData2D
/Trade::MeshData3D
overloads are still present for backwards compatibility) Platform::*ApplicationviewportEvent(const Vector2i&)
, override the viewportEvent(ViewportEvent&) function instead.Platform::Sdl2Application::Configuration::WindowFlags::AllowHighDpi
, had no effect anymoreShaders::GenericGL::Color
andShaders::VertexColorGL::Color
, use Shaders::VertexColorGL:: Color3 or Shaders:: VertexColorGL:: Color4 instead - Trade::
CameraData constructor not taking an explicit type enum, use Trade:: CameraData:: CameraData(CameraType, Rad, Float, Float, Float, const void*) instead Trade::AbstractMaterialData
constructor taking just two parameters and Trade::PhongMaterialData constructor taking three parameters, use either the (also deprecated) Trade::AbstractMaterialData::AbstractMaterialData(MaterialType, Flags, MaterialAlphaMode, Float, const void*)
andTrade::PhongMaterialData::PhongMaterialData(Flags, MaterialAlphaMode, Float, Float, const void*)
constructors or directly the new Trade::MaterialData class
- Removed APIs deprecated in 2019.01, in particular:
TextureTools::distanceField()
, use the TextureTools::DistanceFieldGL class instead.
- Removed APIs deprecated in 2019.10, in particular:
Math::Color3::Hsv
andMath::Color4::Hsv
std::tuple typedefs and Math:: Color3:: fromHsv() / Math:: Color4:: fromHsv() overloads taking separate hue, saturation and value arguments. Use the Math:: ColorHsv struct instead. Math::swizzle()
, use Math::gather() instead Text::FontFeature::MultiFile
,Text::AbstractFont::openData()
taking a vector of pairs, andopenSingleData()
, use Text::AbstractFont:: openData() and setFileCallback() for opening multi-file fonts instead
- All includes of Corrade/
Containers/ PointerStl.h and Corrade/ Containers/ ArrayViewStl.h that were added in 2019.01 for preserving backwards compatibility after the move from std:: unique_ptr / std:: vector to Corrade:: Containers:: Pointer / Corrade:: Containers:: ArrayView are now removed. This should have a significant positive effect on compile times of code using the GL, Audio, Trade and Text libraries - Animation::
Easing is now a typedef to a new Animation:: BasicEasing struct instead of being a namespace in order to expose the easing functions in double precision as Animation:: Easingd. The change is API-compatible and shouldn't require any changes from user side, however existing code that contained using namespace Animation::Easing
will break. - As part of the ongoing STL header dependency cleanup, the following breaking changes related to std::
string, std:: vector and std:: pair are done: - DebugTools::
FrameProfiler:: measurementName() and DebugTools:: FrameProfiler:: statistics() now return a Containers:: StringView / Containers:: String instead of a std:: string - GL::
AbstractShaderProgram:: validate() now returns a Containers:: Pair with a Containers:: String instead of a std:: pair with a std:: string; GL:: Shader:: sources() now returns a Containers:: StringIterable instead of a std:: vector of a std:: string See also mosra/ magnum#499 and mosra/ magnum#608. - GL::
Context:: vendorString(), rendererString(), versionString(), shadingLanguageVersionString(), shadingLanguageVersionStrings() and extensionStrings() now return Containers:: StringView or a Containers:: Array / Containers:: ArrayView of them, instead of a std:: string and a std:: vector. - All label() and setLabel() APIs now work with a Containers::
StringView / Containers:: String instead of a std:: string - GL::
version(Version) now returns a Containers:: Pair instead of a std:: pair - MeshTools::
compressIndices(), MeshTools:: removeDuplicates() and related APIs now return a Containers:: Pair instead of a std:: pair - Vk::
DescriptorPoolCreateInfo and Vk:: AttachmentDescription APIs now take a Containers:: Pair instead of a std:: pair - All Math APIs that took or returned std::
pair now use Containers:: Pair instead - Text::
AbstractFont public APIs now take Containers:: StringView instead of std:: string and return Containers:: Pair instead of std:: pair. Additionally, the internal implementation relies on Containers:: ArrayView<const char32_t> instead of std:: u32string and Containers:: Triple instead of std:: tuple, but that shouldn't affect end-user code in any way. To handle most backwards compatibility, Corrade/ Containers/ StringStl.h and/or Corrade/ Containers/ PairStl.h is included in affected headers for implicit conversions from/to a std:: string and/or std:: pair, but in some cases you may be forced to change the code that uses those APIs.
- DebugTools::
- Math::
Algorithms:: svd() that used to return a std:: tuple and printed a message to Error if it didn't converge now returns a Containers:: Triple wrapped in a Containers:: Optional. As the optional makes this a breaking change, no backwards compatibility header for tuple conversion is included. - Image, ImageView and Trade::
ImageData now look for a pixelFormatSize()
API via ADL instead ofpixelSize()
. In case you were passing a custom pixel format enum to the image classes, you have provide a size query function with the new name to make your code compile again. - GL::
TextureFormat:: SR8 and GL:: TextureFormat:: SRG8 were present on ES2 builds by mistake — the EXT_ texture_ sRGB_ R8 and EXT_ texture_ sRGB_ RG8 extensions require OpenGL ES 3.0 at least - GL::
Buffer:: bind() and GL:: TransformFeedback:: attachBuffers() overloads that used to take a std:: initializer_list of std:: tuple are removed, as they caused ambiguity with a new Containers:: Triple overload. If your code used std:: make_tuple() previously, change it to a simple {}
, if you were already using C++14{}
tuple construction, you don't need to change anything. - Math::
Complex:: fromMatrix() and Math:: Quaternion:: fromMatrix() now additionaly assert that the input matrix is a pure rotation without any reflections. Before it only asserted for orthogonality, but that led to arbitrary or even invalid quaternions when a reflection matrix was passed, in case of complex numbers the reflection information was just lost in the process. Existing code that calls these with unsanitized inputs now additionally needs to account for reflection as suggested in the documentation. - Math::
Complex:: data(), Math:: CubicHermite:: data(), Math:: Dual:: data(), Math:: DualComplex:: data(), Math:: DualQuaternion:: data(), Math:: Frustum:: data(), Math:: Quaternion:: data(), Math:: Range:: data() and Math:: RectangularMatrix:: data() are no longer constexpr
in order to make them return a reference to a fixed-size array instead of a pointer, which was deemed a more useful property. - Math::
sign() now always returns a unitless type instead of the input type itself, so it's possible to e.g. extract a sign of an angle value and multiply other angles with it. In a similar spirit, Math:: select() now enforces the interpolation phase to be a unitless type. That was the case with Math:: lerp() already, where using angles for t
didn't even compile, this makes the behavior consistently strict for both. - MeshTools::
primitiveCount() now requires the element count to follow rules defined by a particular primitive to be consistent with requirements of MeshTools:: generateIndices() and related APIs. Before it was just rounding down to the nearest lower primitive count. Platform::WindowlessWindowsEglApplication
is now merged into Platform::WindowlessEglApplication. Since its use case was rather rare (windowless applications on ANGLE on Windows) and it wasn't even built in any packages, it's completely removed without providing any backwards compatibility — switch to Platform:: WindowlessEglApplication instead. - SceneGraph::
Object:: addChild() no longer requires the type constructor to have the last parameter a parent object object pointer, as that was quite limiting. Instead it's calling SceneGraph:: Object:: setParent() afterwards. This can cause compilation breakages in case the type constructor has the parent parameter non-optional, pass the parent explicitly in that case. - SceneGraph trees are now destructed in a way that preserves SceneGraph::
Object:: parent() links up to the root as well as SceneGraph:: AbstractFeature:: object() references. Previous behavior made both nullptr
even before the object/feature destructors were called and so it's assumed no code relied on such behavior, nevertheless it's a subtle change worth mentioning. - magnum-sceneconverter options
--level
,--only-attributes
,--remove-duplicates
and--remove-duplicates-fuzzy
were renamed to--mesh-level
,--only-mesh-attributes
,--remove-duplicate-vertices
and--remove-duplicate-vertices-fuzzy
, respectively, to make it clear they affect meshes and not other scene content - The magnum-sceneconverter
--mesh-level
option now requires--mesh
to be specified as well, instead of being ignored if--mesh
isn't present - Because the magnum-sceneconverter
--only-mesh-attributes
option takes attribute IDs, it can only be used in combination with--mesh
or--concatenate-meshes
. This restriction might be eventually lifted again once it's possible to specify attributes by name. - Due to the rework of Shaders::
PhongGL to support directional and attenuated point lights, the original behavior of unattenuated point lights isn't available anymore. For backwards compatibility, light positions supplied through three-component vectors are now represented as directional lights, which is close, but not exactly the same as before. - The
Shaders::AbstractVector
base class for Shaders::VectorGL and Shaders:: DistanceFieldVectorGL is removed, as its benefits were rather questionable — on the contrary, it made subclass implementation more verbose and less clear - The Text library API was reworked for more features, better efficiency and no dependencies on the STL:
- The
Text::AbstractFont::doLayout()
andText::AbstractLayouter::doRenderGlyph()
virtual interfaces no longer exist, plugins are expected to implement Text::AbstractFont:: doCreateShaper() and a Text:: AbstractShaper subclass instead. Only public APIs of the old interface are preserved for backward compatibility with existing application code. - The
Text::AbstractGlyphCache::begin()
/end()
access via std::unordered_map iterators is removed. Use Text:: AbstractGlyphCache:: glyph() for accessing properties of a particular glyph, for accessing all glyph data then glyphIdsInto(), glyphOffsets() const and glyphRectangles() const. - The Text::
AbstractGlyphCache:: image() query now returns a MutableImageView3D instead of an Image2D in order to support incremental population and texture arrays
- The
- The Text::
Alignment left, right, top and middle values now work with the font metrics and cursor position instead of glyph bounding rectangles, as that's the more commonly expected behavior. The original behavior with alignment based on glyph bounds is now in the *GlyphBounds
variants except for*LeftGlyphBounds
, where the left glyph offset is also removed by the alignment compared to*Left
which performs no horizontal translation like in the original case. Additionally, the*Integer
variants now only round the axis where division by 2 happened for the middle / center alignment, with the other axis kept unchanged. - TextureTools::
DistanceFieldGL now asserts that the output texture has a framebuffer-drawable format. Before it only printed an error message and silently did nothing, causing a hard-to-track error. - The Trade::
AnimationTrackTarget enum was extended from 8 to 16 bits to provide more room for custom targets, consistently with Trade:: MeshAttribute. - Mutable access to Trade::
PhongMaterialData color and texture information, deprecated in 2020.06, is now removed, as it's impossible to implement through the redesigned Trade:: MaterialData APIs. However these APIs were mainly used to populate the contents in asset importers, so this shouldn't cause any breakages in user code. - The deprecated Trade::
MaterialData:: flags() now calculates the output on-the-fly based on what attributes are present. This means that arbitrary extra bits passed to the constructor from AbstractMaterialData
subclasses are now discarded, and thus subclasses have to override theflags()
function to keep the same behavior. - Trade::
MaterialData, which the deprecated Trade::AbstractMaterialData
aliases to, doesn't have avirtual
destructor as subclasses with extra data members aren't a desired use case anymore. - Trade::
MeshData now allows strided index buffers and zero and negative attribute strides for better data layout flexibility, however as this is not commonly supported by GPU APIs, it implies the user is now expected to validate the data layout when passing it there. Due to this change, the Trade:: MeshData:: indices() and mutableIndices() accessors now return a Containers:: StridedArrayView instead of an Containers:: ArrayView — either change your code to accept a strided view instead or use Containers:: StridedArrayView:: asContiguous() to get a contiguous Containers:: ArrayView again. - Trade::
SceneData constructor taking a std:: vector of 2D and 3D children that got deprecated in favor of Trade:: SceneData:: SceneData(SceneMappingType, UnsignedLong, Containers:: Array<char>&&, Containers:: Array<SceneFieldData>&&, const void*) no longer accepts a scene that has both 2D and 3D children. - The deprecated
Trade::AbstractImporter::object*DCount()
,Trade::AbstractImporter::object*DForName()
,Trade::AbstractImporter::object*DName()
andTrade::AbstractImporter::object*D()
accessors now behave different for objects with multiple mesh assignments. This handling was originally present in importer plugins themselves, but as the new Trade::SceneData representation supports multiple mesh/camera/... assignments to a single object natively, the handling was moved to a single place in the compatibility layer. Because the compatibility layer cannot renumber object IDs, the newly added objects are not immediately following the original ID but instead allocated at the end of the object ID range reported by the importer. While the newly added objects have different IDs, they retain the parent name like before. - Trade::
AbstractImporter:: doDefaultScene() is now const
— since the function is not expected to fail, no kind of complex lazy population can be done anyway. This is now consistent withdo*Count()
interfaces, which are alsoconst
and can't fail. Documentation of each function was expanded to suggest a recommended place for potential error handling. - Trade::
AbstractImageConverter:: convertToData() and convertToFile() now expect image views to not be nullptr
and to have a non-zero size in all dimensions. This used to fail for all existing plugin implementations anyway, but now it's treated as a programmer error and thus asserted on. - Trade::
TextureData constructor was not explicit
by mistake, now it is - Trade::
TextureData:: image() used to document that cube map images are six consecutive 2D images with the ID being the index of the first one. That's no longer the case and cube map images are 3D. Because no importer implemented support for cube map images, this shouldn't cause a problem in practice.
Documentation
- Added a note about MinGW GCC and Clang ABI incompatibility to Windows platform docs (see mosra/
magnum#227 and mosra/ magnum#439) - Various documentation fixes (see mosra/
magnum#492, mosra/ magnum#521, mosra/ magnum#563, mosra/ magnum#564) - Corrade::
Utility:: Debug and friends were always brought to the Magnum namespace via a using
directive, but this was never reflected in the docs and thus hidden from users. Now it's shown in the docs as a set of Debug etc typedefs instead, to make them more discoverable. - Improved documentation about delayed OpenGL context creation and related pitfalls (see also mosra/
magnum-bootstrap#26, mosra/ magnum-examples#98) - Added introductory documentation about library layout and essential workflows (see mosra/
magnum#526)
2020.06
Released 2020-06-27, tagged as v2020.06.
New features
- Clang-CL is now a supported compiler on Windows. See also Using Clang-CL.
- New Vector2h, Vector3h, Vector4h, Vector2ub, Vector3ub, Vector4ub, Vector2b, Vector3b, Vector4b, Vector2us, Vector3us, Vector4us, Vector2s, Vector3s, Vector4s, Color3h, Color4h, Color3us, Color4us convenience typedefs for half-float, 8- and 16-bit integer vector and color types
- New storage-only Matrix2x2h, Matrix2x2b, Matrix2x2s, Matrix2x3h, Matrix2x3b, Matrix2x3s, Matrix2x4h, Matrix2x4b, Matrix2x4s, Matrix3x2h, Matrix3x2b, Matrix3x2s, Matrix3x3h. Matrix3x3b, Matrix3x3s, Matrix3x4h, Matrix3x4b, Matrix3x4s, Matrix4x2h, Matrix4x2b, Matrix4x2s, Matrix4x3h, Matrix4x3b, Matrix4x3s, Matrix4x4h, Matrix4x4b, Matrix4x4s convenience typedefs for half-float, 8- and 16-bit packed matrix types
- New VertexFormat enum for vertex formats and related utilities
- New MeshPrimitive::
Instances, MeshPrimitive:: Faces and MeshPrimitive:: Edges primitive types for describing per-instance, per-face and per-edge data. Those don't map to any common GPU API, but can be used by various importers to provide access to mesh data that is not necessarily GPU-friendly.
Animation library
- Added a Animation::
TrackViewStorage:: values() getter for type-erased access to track values
Audio library
- Added a Audio::
Buffer:: frequency() getter
DebugTools library
- New DebugTools::
ColorMap namespace containing a few presets for gradient visualization - New DebugTools::
FrameProfiler utility for CPU and GPU profiling
GL library
- Exposed new entry points. Note that no wrapper API in the GL namespace is provided for the extensions listed below, at the moment:
- Desktop / ES OVR_
multiview and OVR_ multiview2 extensions and the WebGL OVR_ multiview2 extension. See also mosra/ magnum#385. - ARB_
sample_ locations and AMD_ sample_ positions desktop extensions; NV_ sample_ locations desktop and ES extension
- Desktop / ES OVR_
- Implemented EXT_
draw_ buffers2, ARB_ draw_ buffers_ blend desktop extensions, EXT_ draw_ buffers_ indexed ES extension and EXT_ draw_ buffers_ indexed WebGL 2 extension in GL:: Renderer - Implemented GL::
Renderer:: setPatchVertexCount(), GL:: Renderer:: setPatchDefaultInnerLevel() and GL:: Renderer:: setPatchDefaultOuterLevel() as the last missing bits for ARB_ tessellation_ shader / EXT_ tessellation_ shader support (see mosra/ magnum#164) - Implemented GL::
PipelineStatisticsQuery from GL 4.6 - Implemented GL:Renderer::
Feature:: ClipDistance0 through GL:Renderer:: Feature:: ClipDistance7 and related limit queries as well as exposing the APPLE_ clip_ distance / EXT_ clip_ cull_ distance ES and EXT_ clip_ cull_ distance WebGL extensions - Recognizing AMD_
shader_ explicit_ vertex_ parameter desktop and NV_ fragment_ shader_ barycentric desktop / ES extensions. These add only shading language features. - A
"intel-windows-crazy-broken-buffer-dsa"
and"intel-windows-crazy-broken-vao-dsa"
workarounds for Intel Windows drivers, disabling ARB_direct_ state_ access code paths in everything releated to buffers and meshes. There are several issues occurring only in heavier apps, impossible to track down and reproduce in a controlled environment. These two replace the previous "intel-windows-buggy-dsa-bufferdata-for-index-buffers"
workaround that attempted to fix this by doing an explicit buffer binding in some cases. See Driver workarounds and mosra/magnum#405 for more information. - A
"apple-buffer-texture-unbind-on-buffer-modify"
workaround that fixes crashes on Apple macOS when attempting to modify a GL::Buffer when a GL:: BufferTexture is bound. See Driver workarounds for more information. - New GL::
Buffer:: Buffer(Containers:: ArrayView<const void>, BufferUsage) constructor for directly creating buffers filled with data. - New GL::
Mesh:: maxVertexAttributeStride() and GL:: AbstractShaderProgram:: maxGeometryOutputVertices() limit queries - Added a GL::
Shader:: Shader(NoCreateT) constructor for consistency with other OpenGL wrapper objects
Math library
- New Magnum/
Math/ PackingBatch.h header with batch Math:: packInto(), Math:: unpackInto(), Math:: packHalfInto(), Math:: unpackHalfInto() and Math:: castInto() functions for optimized (un)packing and casting of large amounts of data (see also mosra/ magnum#275) - Added Math::
Quaternion:: toEuler() and documented how to convert Euler angles to a quaternion (see mosra/ magnum#397) - Added Math::
DualComplex:: transformVector(), Math:: DualQuaternion:: transformVector(), Math:: DualQuaternion:: transformVectorNormalized() delegating to respective APIs in the underlying Complex / Quaternion to make the transformation API more consistent with Matrix3 / Matrix4 - Added Math::
reflect() and Math:: refract() (see mosra/ magnum#420)
MeshTools library
- New magnum-sceneconverter tool, similar to magnum-imageconverter but suited for general scene formats
- Added MeshTools::
compile(const Trade:: MeshData&) operating on the new Trade:: MeshData API - New MeshTools::
isInterleaved() and MeshTools:: interleavedData() utilities for checking if Trade:: MeshData is interleaved and for getting an interleaved view - Added MeshTools::
interleavedLayout() for convenient creation of an interleaved mesh layout using the new Trade:: MeshData API - Added
MeshTools::interleave(const Trade::MeshData&, Containers::ArrayView<const Trade::MeshAttributeData>)
, MeshTools::duplicate(const Trade:: MeshData&, Containers:: ArrayView<const Trade:: MeshAttributeData>), MeshTools:: compressIndices(const Trade:: MeshData&, MeshIndexType) and MeshTools:: removeDuplicates(const Trade:: MeshData&) that work directly on the new Trade:: MeshData API - Added MeshTools::
subdivideInPlace() for allocation-less mesh subdivision - New MeshTools::
removeDuplicatesInPlace() variant that works on discrete data in addition to floating-point - New MeshTools::
combineIndexedAttributes() tool for combining differently indexed attributes into a single index buffer, and MeshTools:: combineFaceAttributes() for converting per-face attributes into per-vertex - New MeshTools::
concatenate() and MeshTools:: concatenateInto() tool for batching multiple generic meshes together - MeshTools::
primitiveCount() for calculating number of generated primitives for a particular primitive type - New family of MeshTools::
generateLineStripIndices(), MeshTools:: generateLineLoopIndices(), MeshTools:: generateTriangleStripIndices() and MeshTools:: generateTriangleFanIndices() utilities for converting various mesh types to plain indexed MeshPrimitive:: Lines and MeshPrimitive:: Triangles, as well as MeshTools:: generateIndices() operating directly on a Trade:: MeshData
Platform libraries
- Cursor management using Platform::
Sdl2Application:: setCursor(), Platform:: GlfwApplication:: setCursor() and Platform:: EmscriptenApplication:: setCursor() (see mosra/ magnum#383 and mosra/ magnum#415) - Added Platform::
GlfwApplication:: setWindowSize() and Platform:: Sdl2Application:: setWindowSize() - Window icon management using Platform::
Sdl2Application:: setWindowIcon() and Platform:: GlfwApplication:: setWindowIcon() (see mosra/ magnum#393) - Added Platform::
GlfwApplication:: warpCursor() to match the equivalent API in Platform:: Sdl2Application (see mosra/ magnum#383) - Implemented Platform::
GlfwApplication:: mainLoopIteration() and Platform:: AbstractXApplication:: mainLoopIteration() for consistency with Platform:: Sdl2Application (see mosra/ magnum#387) - Added Key::
Quote, Key:: LeftBracket, Key:: RightBracket, Key:: Backslash and Key:: Backquote keys to Platform:: Sdl2Application:: KeyEvent and Platform:: GlfwApplication:: KeyEvent - Added Platform::
GlfwApplication:: KeyEvent:: Key:: World1 and Platform:: GlfwApplication:: KeyEvent:: Key:: World2 - Added Platform::
EmscriptenApplication:: KeyEvent:: Key:: Semicolon - New base-gtkmm bootstrap project for using Magnum together with gtkmm (see mosra/
magnum-bootstrap#24) - Context sharing in Platform::
WindowlessCglApplication, Platform:: WindowlessEglApplication, Platform:: WindowlessGlxApplication, Platform:: WindowlessWglApplication and Platform::WindowlessWindowsEglApplication
(see mosra/magnum#433 and mosra/ magnum#437) - CUDA device selection in Platform::
WindowlessEglApplication (see mosra/ magnum#449) - Added Platform::
GlfwApplication:: Configuration:: WindowFlag:: Borderless - Added Platform::
Sdl2Application:: Configuration:: WindowFlag:: FullscreenDesktop, AlwaysOnTop, SkipTaskbar, Utility, Tooltip and PopupMenu - Added Platform::
Sdl2Application:: Configuration:: addWindowFlags() and clearWindowFlags() for consistency with similar functions in Platform:: Sdl2Application:: GLConfiguration; same done for Platform:: GlfwApplication as well
Primitives library
SceneGraph library
- All 2D transformation implementations that support rotation now have a rotate() and rotateLocal() overloads taking a Math::
Complex - All 3D transformation implementations that support rotation now have a rotate() and rotateLocal() overloads taking a Math::
Quaternion
Shaders library
- New
Shaders::MeshVisualizer2D
for 2D mesh visualization - Tangent space visualization in
Shaders::MeshVisualizer3D
- Object, vertex and primitive ID visualization in
Shaders::MeshVisualizer2D
andShaders::MeshVisualizer3D
- Texture coordinate transformation in
Shaders::DistanceFieldVector
,Shaders::Flat
,Shaders::Phong
andShaders::Vector
- Ability to render per-instance / per-vertex object ID in
Shaders::Flat
andShaders::Phong
, in addition to uniform object ID - New attribute definitions and an location allocation scheme in
Shaders::Generic
—Shaders::Generic::Tangent4
,Shaders::Generic::Bitangent
,Shaders::Generic::ObjectId
plusShaders::Generic::TransformationMatrix
,Shaders::Generic::NormalMatrix
andShaders::Generic::TextureOffset
for instancing - Instancing in
Shaders::Flat
andShaders::Phong
Trade library
- A new, redesigned Trade::
MeshData class that allows much more flexible access to vertex/index data without unnecessary allocations and data conversions or copies. Importers expose it through the new Trade:: AbstractImporter:: mesh() family of APIs. See mosra/ magnum#371. - New Trade::
AbstractSceneConverter plugin interface and an AnySceneConverter plugin - Ability to import image mip levels via an additional parameter in Trade::
AbstractImporter:: image2D(), Trade:: AbstractImporter:: image2DLevelCount() and similar APIs for 1D and 3D images - The Trade::
AnimationData class received support for mutable data access with new constructors and the mutableData() and mutableTrack() accessors. Equivalent APIs are exposed in both Trade:: ImageData and Trade:: MeshData as well. See Mutable data access for more information. - New convenience
Trade::AbstractImporter::material(const std::string&)
etc. APIs allowing to directly get a data using a string name - Trade::
PhongMaterialData now supports both color and texture instead of just one or the other, can reference normal textures as well and specfify texture coordinate transform - Trade::
PhongMaterialData now supports non-default texture coordinate sets (see mosra/ magnum#278, mosra/ magnum#438) - Added Trade::
AbstractImporter:: setFlags() and Trade:: AbstractImageConverter:: setFlags() for configuring common plugin behavior such as output verbosity level; exposed also via a new --verbose
option in magnum-imageconverter and magnum-sceneconverter - magnum-imageconverter has a new
--info
option for printing detailed info about a particular file - RLE compression support in TgaImporter
Vk library
- Updated Vulkan headers for version 1.2
- Conversion of VertexFormat values to the VkFormat enum using
Vk::vkFormat(Magnum::VertexFormat)
Changes and improvements
- The MeshPrimitive type can now store implementation-specific primitive types similarly to PixelFormat and the new VertexFormat. Implementation-specific types are then simply passed through in GL::
meshPrimitive() and Vk::vkPrimitiveTopology()
. - The PixelFormat and CompressedPixelFormat enums can now be saved and retrieved from Corrade::
Utility:: Configuration / Corrade:: Utility:: Arguments - Resource is now nothrow-movable and thus can be used with growable Corrade::
Containers:: Array instances - Reworked plugin search paths to prefer autodetection based on library or executable location where possible and use hardcoded paths only if explicitly specified. See Trade::
AbstractImporter:: pluginSearchPaths() for more information. - Added an ability to disable unique globals across shared libraries using MAGNUM_
BUILD_ STATIC_ UNIQUE_ GLOBALS on static builds that don't need it - Library version is now exposed through
MAGNUM_VERSION_YEAR
,MAGNUM_VERSION_MONTH
,MAGNUM_VERSION_COMMIT
,MAGNUM_VERSION_HASH
andMAGNUM_VERSION_STRING
preprocessor defines in a newMagnum/version.h
header. This header is not included by any other header to avoid trigerring a full rebuild when Git commit changes. If Git is not found, only the first two defines are present. Shaders::MeshVisualizer3D::Flag::Wireframe
now implicitly enablesShaders::MeshVisualizer3D::Flag::NoGeometryShader
also on WebGL in addition to ES2, since this platform doesn't have a possibility to have geometry shaders either. Same is done forShaders::MeshVisualizer2D
.
Audio library
- WavAudioImporter now supports also Big-Endian
RIFX
files and was fixed to work on Big-Endian platforms (see mosra/corrade#87)
GL library
- Added GL::
AbstractTexture:: bind(), GL:: AbstractTexture:: bindImages() and GL:: AbstractShaderProgram:: draw() overloads taking a Corrade:: Containers:: ArrayView instead of std:: initializer_list in order to allow passing runtime-sized lists (see also mosra/ magnum#403) - Added an ability to remove a buffer from a GL::
BufferTexture using resetBuffer() - Matrix GL::
Attribute instances can now specify custom stride between column vectors in order to control alignment in packed 8- and 16-bit types - GL::
DynamicAttribute can now describe matrix attributes similarly to GL:: Attribute, previously this was possible only by specifying each column vector separately - Added GL::
Context:: State:: UnbindPixelBuffer that's now implicitly included in GL:: Context:: State:: EnterExternal to make Magnum work correctly with 3rd party code that's not aware of PBOs. - The
"intel-windows-explicit-uniform-location-is-less-explicit-than-you-hoped"
workaround now unconditionally disables ARB_explicit_ uniform_ location on Intel Windows drivers because it was discovered to be too buggy to be useful, affecting most shaders from the Shaders library. See also Driver workarounds.
Math library
- Functions in Magnum/
Math/ FunctionsBatch.h now accept any type that's convertible to a Corrade:: Containers:: StridedArrayView without having to add explicit casts or template parameters - Math::
slerp(const Quaternion<T>&, const Quaternion<T>&, T) and Math:: slerpShortestPath(const Quaternion<T>&, const Quaternion<T>&, T) now fall back to linear interpolation when the quaternions are close to each other, instead of unconditionally returning the first argument - Added non-const overloads to Math::
Frustum:: operator[]() and Math:: Frustum:: near() etc. accessors, returning references (see mosra/ magnum#425)
MeshTools library
- Added MeshTools::
compressIndices() that takes a Corrade:: Containers:: StridedArrayView instead of a std:: vector and additionally allows you to specify the smallest allowed type, offset to apply to each index and is working with 8- and 16-byte index types as well - Added MeshTools::
subdivide() that operates on a (growable) Corrade:: Containers:: Array instead of a std:: vector - Added MeshTools::
subdivideInPlace() that operates on a partially filled array view instead of a std:: vector - Added MeshTools::
removeDuplicatesIndexedInPlace() that operates in-place on an indexed array view and a STL-less MeshTools:: removeDuplicatesInPlace() variant - Added MeshTools::
duplicateInto() variants that take type-erased 2D strided array views - MeshTools::
flipNormalsInPlace() and MeshTools:: flipFaceWindingInPlace() were renamed for clarity and now accept a Corrade:: Containers:: StridedArrayView instead of a std:: vector, additionally working on 8- and 16-byte index types as well - MeshTools::
tipsifyInPlace() was renamed for clarity and now accepts a Corrade:: Containers:: StridedArrayView instead of a std:: vector, additionally working on 8- and 16-byte index types as well - Added MeshTools::
generateSmoothNormals() and MeshTools:: generateSmoothNormalsInto() variants taking type-erased index arrays
Platform libraries
- Platform::
GlfwApplication now gracefully handles monitor sizes of zero when calculating DPI scaling (see mosra/ magnum#388) - Ability to specify application return code in Platform::
AbstractXApplication:: exit() - Worked around Platform::
GlfwApplication crash while creating GL context on a hidden window on Wayland (see mosra/ magnum#392, mosra/ magnum#400, mosra/ magnum#401) - HiDPI capability checking on macOS and iOS got fixed to behave correctly when the capability is explicitly set to
<false/>
in theInfo.plist
file and additionally, unless overridden, it's assumed to be enabled by default on macOS 10.15+ and iOS 13+. Applications running on these platforms no longer need to supply a customInfo.plist
in order to enable HiDPI. See HiDPI (Retina) support for more information. - Implemented virtual DPI scaling in Platform::
GlfwApplication on Windows (was behaving like physical before) and physical DPI scaling in Platform:: Sdl2Application (which was behaving like virtual before) (see mosra/ magnum#243) - Undefining more noise from
Xlib.h
(see mosra/magnum#430) - Calling Platform::
*Application:: exit() directly in the application constructor will now make it exit right after constructor finished, without any event processing (see mosra/ magnum#429) - Platform::
AndroidApplication, Platform:: EmscriptenApplication, Platform:: GlfwApplication and Platform:: Sdl2Application now default to 32-bit RGBA color buffer instead of 24-bit RGB, to avoid the framebuffer degrading to 16-bit colors on some platforms (see mosra/ magnum-integration#59) - Added Platform::
BasicScreenedApplication:: globalBeforeDrawEvent() - Platform::
WindowlessGlxApplication now handles GLXBadFBConfig
errors gracefully, making the fallback compatibility context creation work even in those cases. This makes it work with Mesa's Zink GL-over-Vulkan driver. - Following all other application implementations, Platform::
WindowlessEglApplication now implements the "no-forward-compatible-core-context"
workaround as well, giving back latest OpenGL version on proprietary NVidia and AMD drivers instead of OpenGL 3.0. The newly added fallback also makes the application work with Mesa's Zink GL-over-Vulkan driver that has just GL 2.1. See also Driver workarounds.
Trade library
- For better usability, the magnum-imageconverter utility now prints available importer/converter plugins when loading a plugin fails
- magnum-imageconverter can load a tightly-packed square of raw pixels instead of going through an importer plugin if you specify
--importer raw:<format>
; and save raw imported data instead of going through a converter plugin if you specify--converter raw
- magnum-imageconverter can be told to load a particular image and level using the
--image
and--level
options - New convenience Trade::
AnimationTrackData constructor taking a templated Animation:: TrackView type, autodetecting value and result Trade:: AnimationTrackType out of it - New convenience Trade::
AnimationData constructors taking an std:: initializer_list of Trade:: AnimationTrackData - Recognizing
*.ico
and*.cur
files in AnyImageImporter
Build system
- Fixed a bad interaction between Magnum/
Platform/ AbstractXApplication.h and Magnum/ Platform/ GlfwApplication.h (see mosra/ magnum#389) FindSDL2.cmake
got updated to link to all dependencies when using a statically built SDL on WindowsFindSDL2.cmake
now links to Metal in addition to other frameworks on iOS and is updated to link to these only if SDL is statically built (see mosra/magnum#410) FindMagnum.cmake
now properly recognizes an optional dependency between DebugTools and Trade on GL-less builds- Various compiler warning fixes (see mosra/
magnum#406) - Added a 32-bit Windows build to the CI matrix to avoid random compilation issues (see mosra/
magnum#421) - The library again compiles and tests cleanly with CORRADE_
NO_ ASSERT enabled, and this setup is verified on the CI to avoid further regressions - Worked around a regression in MSVC 2017 causing a compiler crash (see mosra/
magnum#440) - Linker fixes for MinGW Clang (see mosra/
magnum#417) - Properly installing plugin binaries in Gentoo packages (see mosra/
magnum-plugins#85) - Warning fixes for MSVC (see mosra/
magnum#445) FindOpenAL.cmake
was rewritten from scratch to support linking against statically built OpenAL Soft (through its CMake config file) as well as OpenAL Soft added as a CMake subproject. Moreover, when using Magnum as a CMake subproject, the Audio library now copies the OpenAL DLL toCMAKE_RUNTIME_OUTPUT_DIRECTORY
(if set) as a post-build step. The DLL location, if found, is also available through anOPENAL_DLL_RELEASE
variable for use by 3rd party code. See also mosra/magnum#402 and mosra/ magnum#412 for more information. - Updated Android building and troubleshooting guide to make it work with NDK r19+ and CMake 3.16+. See also mosra/
corrade#84 and mosra/ magnum#310. - Vcpkg packages now ignore features that are incompatible with target platform, allowing
vcpkg install magnum[*]
to work again. See also mosra/magnum#368 and microsoft/ vcpkg#12211.
Bug fixes
- The variadic versions of GL::
Mesh:: addVertexBuffer() and GL:: Mesh:: addVertexBufferInstanced() were sometimes errorneously picked up instead of the GL:: DynamicAttribute overloads when stride and offset were of a slightly different type. - Platform::
Sdl2Application:: viewportEvent() gets properly fired also when window size changes programmatically (such as through setMinWindowSize()) - Platform::
GlfwApplication:: setMinWindowSize() / Platform:: GlfwApplication:: setMaxWindowSize() and equivalent APIs in Platform:: Sdl2Application now correctly take DPI scaling into account - The Primitives::
cylinderSolid() and Primitives:: coneSolid() primitives were missing a face when both caps and texture coordinates were enabled (see mosra/ magnum#386) - Platform::
Sdl2Application:: Configuration:: WindowFlag:: Vulkan was enabled conditionally only for SDL >= 2.0.6, but the version defines were never included so it was always disabled - Fixed missing handling of Key::
LeftBracket, Key:: RightBracket, Key:: Semicolon and Key:: Backquote in Platform:: EmscriptenApplication - Fixed broken Platform::
EmscriptenApplication mouse event coordinates when -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
is enabled (see mosra/magnum#408) - Fixed compilation of Platform::
EmscriptenApplication on recent Emscripten versions (see mosra/ magnum#434) - Due to Windows- and macOS-specific issues in GLFW, Platform::
GlfwApplication:: viewportEvent() and/or Platform:: GlfwApplication:: drawEvent() could get fired already during class construction, potentially causing crashes or pure virtual method call
aborts. To prevent these issues, event callback setup is delayed to the first time the application main loop is entered. - Platform::
GlfwApplication was polling for events instead of waiting, using 100% CPU even if not constantly redrawing - In 2019.01 Magnum/
Platform/ Sdl2Application.h went through an include cleanup, removing 50k lines; but unfortunately we forgot to add back #include <SDL_main.h>
, causing iOS builds to fail to initialize. The include got added back and initialization failures are reported with more information now. - Calling Platform::
Sdl2Application:: setSwapInterval() with 0
caused setMinimalLoopPeriod() to be ignored even though Vsync was in fact not enabled. - It was not possible to override DPI scaling using Platform::
Sdl2Application:: Configuration as command-line arguments always got a priority (see mosra/ magnum#416) - Fixed an otherwise harmless OOB access in MeshTools::
tipsifyInPlace() that could trigger ASan or debug iterator errors - With Corrade/
Utility/ DebugStl.h not being included, std:: string instances could get accidentally printed as ResourceKey instances. Added and explicit header dependency to avoid such cases. - The Magnum/
Image.h, Magnum/ ImageView.h and Magnum/ Trade/ ImageData.h headers required Corrade/ Containers/ StridedArrayView.h to be included before in order to use the pixels() function. Now it's enough to just include it at any point, with no order dependency anymore. - Dynamic plugins on static Magnum builds on Windows were accidentally searched for in the
lib/
directory instead ofbin/
, and in some cases inbin/
instead oflib/
on Unix platforms. - Resource was unnecessarily querying the ResourceManager for updated data even in cases where no resource update was done since last check
- For a
Shaders::Phong
with zero lights, alpha mask default value was incorrectly0.0f
instead of0.5f
on OpenGL ES Shaders::MeshVisualizer3D
accidentally didn't enablenoperspective
interpolation on desktop, resulting in minor wireframe rendering artifacts- Math::
angle() got fixed to not produce NaN results for vectors, complex numbers or quaternions very close to each other - Math::
Range was made to be implicitly convertible from std:: pair in 2018.10, but the Math:: Range2D and Math:: Range3D were only explicitly, and even that only by an accident - Fixed various cases where GL::
Context would call GL 3+ APIs on GL 2.1 contexts, causing GL errors. This makes context creation completely error-free on Mesa's Zink GL-over-Vulkan driver.
Deprecated APIs
GL::Mesh::draw()
andGL::MeshView::draw()
are deprecated in favor of GL::AbstractShaderProgram:: draw() and GL:: AbstractShaderProgram:: drawTransformFeedback(), as the API makes much more sense to have on a shader and not on a mesh GL::Attribute::DataType::HalfFloat
,GL::DynamicAttribute::DataType::HalfFloat
andGL::PixelType::HalfFloat
is deprecated in favor of GL::Attribute:: DataType:: Half, GL:: DynamicAttribute:: DataType:: Half and GL:: PixelType:: Half that are consistent with the Half type used elsewhere. GL::Attribute::vectorSize()
is deprecated as the name is misleading now, use GL::Attribute:: vectorStride() instead GL::Attribute::VectorCount
is deprecated in favor of GL::Attribute:: Vectors to have a name consistent with GL:: Attribute:: components() Trade::AbstractImporter::mesh2D()
,Trade::MeshData2D
,Trade::MeshData3D
,Trade::AbstractImporter::mesh2D()
,Trade::AbstractImporter::mesh3D()
and related APIs are deprecated in favor of Trade::AbstractImporter:: mesh() and the new Trade:: MeshData API. For backwards compatibility, importers implementing the new API have it exposed through mesh3D()
as well, returning a subset of Trade::MeshData functionality supported by the old Trade::MeshData3D
APIsPlatform::GlfwApplication::Configuration::setCursorMode()
and related enum & getter are deprecated in favor of the new extended and more flexible Platform::GlfwApplication:: setCursor(). The setting didn't allow changing the cursor later, which made it pretty useless. Platform::Sdl2Application::Configuration::setMouseLocked()
andPlatform::Sdl2Application::Configuration::isMouseLocked()
is deprecated in favor of the new Platform::Sdl2Application:: setCursor() together with Platform:: Sdl2Application:: Cursor:: HiddenLocked Platform::GlfwApplication::Configuration::WindowFlag::Floating
is deprecated in favor of a more descriptive Platform::GlfwApplication:: Configuration:: WindowFlag:: AlwaysOnTop, which is also consistent with Platform:: Sdl2Application Audio::AbstractImporter::Features
,Text::AbstractFont::Features
,Text::AbstractFontConverter::Features
,Trade::AbstractImporter::Features
,Trade::AbstractImageConverter::Features
enum sets and their correspondingFeature
enums are deprecated in favor of Audio::ImporterFeatures, Text:: FontFeatures, Text:: FontConverterFeatures, Trade:: ImporterFeatures, Trade:: ImageConverterFeatures enum sets and their corresponding enums placed directly in the namespace to have them shorter and unambiguous MeshTools::compressIndices()
taking a std::vector is deprecated in favor of MeshTools:: compressIndices(const Containers:: StridedArrayView1D<const UnsignedInt>&, MeshIndexType, Long) and its 8- and 16-byte overloads MeshTools::flipNormals()
andMeshTools::flipFaceWinding()
andMeshTools::tipsify()
are deprecated in favor of MeshTools::flipNormalsInPlace(), MeshTools:: flipFaceWindingInPlace() and MeshTools:: tipsifyInPlace() that accept a Corrade:: Containers:: StridedArrayView instead of a std:: vector and work with 8- and 16-byte index types as well. Magnum/MeshTools/CombineIndexedArrays.h
,MeshTools::combineIndexArrays()
andMeshTools::combineIndexedArrays()
are deprecated in favor of a more flexible MeshTools::combineIndexedAttributes() in the Magnum/ MeshTools/ Combine.h header MeshTools::compressIndicesAs()
,MeshTools::duplicate()
,MeshTools::removeDuplicates()
andMeshTools::subdivide()
operating on a std::vector are deprecated, use the STL-free MeshTools:: compressIndices(), MeshTools:: duplicate(), MeshTools:: removeDuplicatesFuzzyInPlace() and MeshTools:: subdivide() / MeshTools:: subdivideInPlace() overloads instead Primitives::CapsuleTextureCoords
,Primitives::CircleTextureCoords
,Primitives::PlaneTextureCoords
,Primitives::SquareTextureCoords
,Primitives::UVSphereTextureCoords
enums and Primitives::capsule3DSolid(), Primitives:: circle2DSolid(), Primitives:: circle3DSolid(), Primitives:: planeSolid(), Primitives:: squareSolid() and Primitives:: uvSphereSolid() overloads taking those are deprecated in favor of Primitives:: CapsuleFlags, Primitives:: Circle2DFlags, Primitives:: Circle3DFlags, Primitives:: PlaneFlags, Primitives:: SquareFlags and Primitives:: UVSphereFlags Primitives::ConeFlag::GenerateTextureCoords
,Primitives::CylinderFlag::GenerateTextureCoords
,Primitives::GridFlag::GenerateTextureCoords
andPrimitives::GridFlag::GenerateNormals
is deprecated in favor of Primitives::ConeFlag:: TextureCoordinates, Primitives:: CylinderFlag:: TextureCoordinates, Primitives:: GridFlag:: TextureCoordinates and Primitives:: GridFlag:: Normals for naming consistency Shaders::MeshVisualizer
is deprecated as the shader can now handle both 2D and 3D, useShaders::MeshVisualizer3D
instead- Default constructor of
Shaders::MeshVisualizer3D
is deprecated, you're now required to enable at least one visualization feature when constructing it Shaders::MeshVisualizer::setTransformationProjectionMatrix()
is deprecated on the 3D variant, use separateShaders::MeshVisualizer3D::setTransformationMatrix()
andShaders::MeshVisualizer3D::setProjectionMatrix()
instead- Mutable access to Trade::
PhongMaterialData color and texture information is deprecated. This was mainly used to populate the contents in asset importers, but the class was redesigned and this is no longer needed. - The unprefixed and alien-looking
FLOAT_EQUALITY_PRECISION
,DOUBLE_EQUALITY_PRECISION
andLONG_DOUBLE_EQUALITY_PRECISION
macros are no longer used by any code and thus deprecated in favor of using Math::TypeTraits:: epsilon() instead, which is also consistent with how This also means it's no longer possible to override equality comparison epsilons at compile time, but that was a rarely (if ever) used feature. DebugTools::Profiler
is obsolete, replaced with a much more flexible and extensible DebugTools::FrameProfiler Math::NoInitT
andMath::NoInit
constructor tags are deprecated in favor of NoInitT and NoInit directly in the Magnum namespace
Potential compatibility breakages, removed APIs
- TrackView in the still-experimental Animation library was changed to allow mutable access to the keys & values it references. Existing code needs to be changed to say
TrackView<const K, const V>
instead ofTrackView<K, V>
. Following this change, Trade::AnimationData now also return instances with const
types and the non-const Trade::AnimationData:: data() was renamed to mutableData(). - The 4-argument GL::
DynamicAttribute constructor was not marked as explicit
by mistake, it's done now to enforce readability in long expressions. - The Magnum/
Math/ FunctionsBatch.h header is no longer included from Magnum/ Math/ Functions.h for backwards compatibility in order to speed up compile times. - Trade::
AnimationTrackData constructors are now explicit as that enforces better readability in long initializer expressions - Non-const Trade::
ImageData:: data() and Trade:: ImageData:: pixels() were renamed to Trade:: ImageData:: mutableData() and Trade:: ImageData:: mutablePixels() to follow the new Trade:: MeshData API and similar changes in Trade:: AnimationData. - Platform::
GlfwApplication:: setMinWindowSize() / Platform:: GlfwApplication:: setMaxWindowSize() and equivalent APIs in Platform:: Sdl2Application now premultiply the value with dpiScaling() to work independently on display DPI. This might break existing uses. - Primitives::
uvSphereWireframe() now correctly asserts when the segments
parameter isn't divisible by four. Before it mistakenly asserted only ifsegments
wasn't divisible by two, and now code that mistakenly used a disallowed value will start asserting. - ResourceManager singleton accessible through
instance()
that was deprecated in 2019.10 is now removed. Usually a deprecated feature is kept for at least a year before removal, but in this case it was severely limiting multithreaded applications and removing it was necessary. - Locations of generic shader attributes was changed in order to accommodate for new attributes and use cases. This may break custom shaders if these rely on generic attribute definitions or are used together with MeshTools::
compile(). To avoid further breakages you're advised to reuse the definitions from Shaders::Generic
(and propagating them to shader code as well) instead of hardcoding the locations directly.Shaders::Generic::Color3
/Shaders::Generic::Color4
location changed from3
to2
Shaders::Generic::Normal
location changed from2
to5
Shaders::Generic::Tangent
location changed from4
to3
- Removed remaining APIs deprecated in version 2018.04:
Audio::Buffer::Format
, use Audio::BufferFormat instead Shaders::*Vector::setVectorTexture()
,Shaders::Flat::setTexture()
,Shaders::Phong::setAmbientTexture()
,Shaders::Phong::setDiffuseTexture()
,Shaders::Phong::setSpecularTexture()
andShaders::Phong::setTextures()
, useShaders::*Vector::bindVectorTexture()
,Shaders::Flat::bindTexture()
,Shaders::Phong::bindAmbientTexture()
,Shaders::Phong::bindDiffuseTexture()
,Shaders::Phong::bindSpecularTexture()
andShaders::Phong::bindTextures()
instead
- MeshPrimitive is now four bytes instead of one, to allow wrapping implementation-specific values using meshPrimitiveWrap() and meshPrimitiveUnwrap()
- MeshPrimitive and MeshIndexType now reserve the zero value to indicate an invalid primitive / type, better catching accidentally forgotten initialization. Valid code shouldn't be affected by this change, but broken code that seemingly worked before might start throwing assertions now. In contrast, SamplerFilter, SamplerMipmap and SamplerWrapping keep the zero value as a reasonable default. This follows a similar change done for PixelFormat and CompressedPixelFormat in 2019.10.
Documentation
- Various fixes, improvements and clarifications (see mosra/
magnum#390, mosra/ magnum#394, mosra/ magnum#418, mosra/ magnum#424) Shaders::Generic
now shows the recommended way how to propagate generic attribute locations to custom shader code (see mosra/magnum#443)
2019.10
Released 2019-10-24, tagged as v2019.10.
Dependency changes
- Minimal supported CMake version is now 3.4. Older versions are not supported anymore and all workarounds for them were removed. Download a prebuilt release of a newer version if you need to use Corrade on older systems (such as Ubuntu 14.04 or Debian 8). This is a conservative change that shouldn't affect any additional distribution compared to the CMake 3.1 requirement in 2019.01.
New features
- MSVC 2019 compatibility, with slightly less workarounds needed compared to MSVC 2017. See also mosra/
magnum-bootstrap#18, mosra/ magnum#343 and mosra/ magnum#354. - When using Magnum as a CMake subproject, it now puts all binaries into a common directory to simplify
PATH
handling and dynamic plugin loading. For more information see Using Magnum as a CMake subproject, mosra/magnum#357 and mosra/ magnum-plugins#63. - New Image::
pixels(), ImageView:: pixels() and Trade:: ImageData:: pixels() accessors for convenient direct access to pixel data of any image - New MutableImageView*D and MutableCompressedImageView*D types for mutable views onto image data
- Added sRGB BC1-3, BC4, BC5, BC6h, BC7, ETC2, EAC, 2D/3D ASTC and PVRTC formats to CompressedPixelFormat as well as their conversion to corresponding GL/Vulkan formats in GL::
compressedPixelFormat() and Vk::vkFormat(Magnum::CompressedPixelFormat)
- New PixelFormat::
R8Srgb, PixelFormat:: RG8Srgb, PixelFormat:: RGB8Srgb and PixelFormat:: RGBA8Srgb sRGB pixel formats as well as their conversion to corresponding GL/Vulkan formats in GL:: pixelFormat() and Vk::vkFormat(Magnum::PixelFormat)
- New
compressedBlockSize()
andcompressedBlockDataSize()
utilities for querying parameters of CompressedPixelFormat entries, similar to whatpixelSize()
is for PixelFormat
Audio library
- Ability to (un)queue buffers in Audio::
Source (see mosra/ magnum#338) - Added getters for basic Audio::
Buffer properties (see mosra/ magnum#342) - Implemented support for AL_
SOFT_ loop_ points in Audio:: Buffer (see mosra/ magnum#342) - Audio::
Context can now take command-line arguments and supports the --magnum-log
and--magnum-disable-extensions
options similarly to GL::Context (see mosra/ magnum#362)
DebugTools library
- New DebugTools::
screenshot() function for convenient saving of screenshots - DebugTools::
CompareImage and variants now properly handle floating-point specials such as NaN or in compared data - DebugTools::
CompareImageFile and DebugTools:: CompareImageToFile now support the new --save-diagnostic option, making it possible to save images when a comparison fails - DebugTools::
CompareImage and variants can now print a verbose diagnostic also if the --verbose
command-line option is specified and comparison delta is non-zero - DebugTools::
CompareImage and DebugTools:: CompareImageToFile now accept also Corrade:: Containers:: StridedArrayView2D on the left side of the comparison for added flexibility. See Comparing against pixel views for more information.
GL library
- Additions to GL::
CompressedPixelFormat and compressed GL:: TextureFormat: - sRGB S3TC formats as defined by the EXT_
texture_ sRGB desktop, EXT_ texture_ compression_ s3tc_ srgb ES and WEBGL_ compressed_ texture_ s3tc_ srgb WebGL extension - Recognizing EXT_
texture_ compression_ dxt1 desktop and ES extension and the ANGLE_ texture_ compression_ dxt1 / ANGLE_ texture_ compression_ dxt3 / ANGLE_ texture_ compression_ dxt5 family of extensions in order to enable S3TC formats on a wider range of OpenGL ES devices - Recognizing the KHR_
texture_ compression_ astc_ sliced_ 3d extension - EXT_
texture_ compression_ rgtc / EXT_ texture_ compression_ bptc OpenGL ES and EXT_ texture_ compression_ rgtc / EXT_ texture_ compression_ bptc WebGL extensions, complementing the desktop support for BC4, BC5, BC6H and BC7 formats - WEBGL_
texture_ compression_ astc WebGL extension, complementing the desktop and ES support for ASTC - OES_
texture_ compression_ astc OpenGL ES extension, adding 3D ASTC compression (unfortunately there's no desktop equivalent yet) - PVRTC formats defined by the IMG_
texture_ compression_ pvrtc / IMG_ pvrtc_ sRGB OpenGL ES and WEBGL_ compressed_ texture_ pvrtc WebGL extensions
- sRGB S3TC formats as defined by the EXT_
- Implemented EXT_
texture_ sRGB_ R8 and EXT_ texture_ sRGB_ RG8 extensions adding GL:: TextureFormat:: SR8 and GL:: TextureFormat:: SRG8 formats to complement new sRGB formats in GL:: PixelFormat - Added ES-only GL::
TextureFormat:: BGRA and GL:: TextureFormat:: BGRA8 and clarified their purpose in relation to GL:: PixelFormat:: BGRA - New GL::
AbstractFramebuffer:: implementationColorReadFormat() and GL:: AbstractFramebuffer:: implementationColorReadType() queries for more robust checks when doing framebuffer readbacks; together with three new workarounds "nv-implementation-color-read-format-dsa-broken"
,"intel-windows-implementation-color-read-format-completely-broken"
and"mesa-implementation-color-read-format-dsa-explicit-binding"
, because it's 2019 and GL drivers are still awful. See Driver workarounds for more information. - Added GL::
BufferTexture:: size() as it was the only texture type were this query was missing. - New
"swiftshader-no-es2-draw-instanced-entrypoints"
and"swiftshader-no-es2-oes-texture-3d-entrypoints"
workarounds disabling ANGLE_instanced_ arrays and OES_ texture_ 3D extensions on SwiftShader due to missing suffixed entry points. See Driver workarounds for more information. - New
"swiftshader-broken-xfb-buffer-binding-target"
workaround that's fixing misbehaving buffers when using GL::Buffer:: TargetHint:: TransformFeedback. See Driver workarounds for more information. - New pseudo-extension
GL_MAGNUM_shader_vertex_id
denoting support of thegl_VertexID
shader builtin. Present on all GL 3.0+, GLES 3.0+ and WebGL 2 contexts, but disabled for SwiftShader as its support is broken (see the"swiftshader-broken-shader-vertex-id"
workaround in Driver workarounds for more information). This pseudo-extension can be also explicitly disabled using the usual--magnum-disable-extensions
command-line option for testing purposes. - An assorted collection of workarounds for Intel Windows drivers "fixing" various issues related to ARB_
direct_ state_ access by using a non-DSA code path in the affected cases — see Driver workarounds for more information: "intel-windows-buggy-dsa-bufferdata-for-index-buffers"
fixing a nasty hard-to-reproduce synchronization bug when GL::Buffer:: setData() is followed by GL:: Mesh:: setIndexBuffer() "intel-windows-broken-dsa-for-cubemaps"
fixing everything about GL::CubeMapTexture (see mosra/ magnum-examples#55) "intel-windows-half-baked-dsa-texture-bind"
fixing texture binding inconsistencies (affected mosra/magnum-examples#55 as well) "intel-windows-broken-dsa-layered-cubemap-array-framebuffer-attachment"
fixing GL::Framebuffer:: attachLayeredTexture() with GL:: CubeMapTextureArray "intel-windows-broken-dsa-framebuffer-clear"
fixing GL::Framebuffer:: clearColor() "intel-windows-broken-dsa-indexed-queries"
fixing GL::PrimitiveQuery:: begin(UnsignedInt) "intel-windows-broken-dsa-integer-vertex-attributes"
fixing GL::Mesh:: addVertexBuffer() with Short attributes
- New AMD Windows driver workarounds, related to ARB_
direct_ state_ access as well — see Driver workarounds for more information: "amd-windows-cubemap-image3d-slice-by-slice"
for broken handling of cube map image download and upload in DSA APIs"amd-windows-broken-dsa-cubemap-copy"
for broken framebuffer-to-cubemap copies in DSA APIs"amd-windows-dsa-createquery-except-xfb-overflow"
using a non-DSA code path for creating GL::PrimitiveQuery:: Target:: TransformFeedbackOverflow queries
- New
"arm-mali-timer-queries-oom-in-shell"
workaround for ARM Mali drivers on Android disabling the EXT_disjoint_ timer_ query extension in Android shell (as opposed to an APK) because using it causes the GL:: Renderer:: Error:: OutOfMemory error. See Driver workarounds for more information. - Implemented EXT_
disjoint_ timer_ query and EXT_ disjoint_ timer_ query_ webgl2 for WebGL, together with a new "firefox-fake-disjoint-timer-query-webgl2"
workaround. See Driver workarounds, Timer queries not available in the browser and Queries always report zero results for more information about various caveats. - Explicitly calling
glEnable(GL_POINT_SPRITE)
on compatibility contexts in order to ensure the GLSLgl_PointCoord
variable has a defined output. On core and ES/WebGL contexts this is enabled implicitly, but for example NVidia drivers havegl_PointCoord
undefined whenGL_POINT_SPRITE
is not enabled on compatibility contexts. - New
--magnum-gpu-validation
command-line option and a corresponding environment variable to conveniently enable KHR_debug debug output. This flag also causes GLConfiguration:: Flag:: Debug to be enabled for context creation on both windowed and windowless applications - Detection of SwiftShader and ARM Mali drivers with GL::
Context:: DetectedDriver:: SwiftShader and GL:: Context:: DetectedDriver:: ArmMali - It's now possible to pass std::
initializer_list to GL:: Buffer:: setData() / GL:: Buffer:: setSubData() for a succint upload of basic types - Added an ability to use Magnum with multiple OpenGL contexts using GL::
Context:: makeCurrent(), see Using multiple OpenGL contexts for more information - GL::
AbstractFramebuffer:: read(), GL:: Texture:: image(), GL:: Texture:: subImage(), GL:: Texture:: compressedImage(), GL:: Texture:: setCompressedSubImage() and equivalent APIs in other texture classes now can read the pixels into MutableImageView*D and MutableCompressedImageView*D as well - GL::
hasTextureFormat() and GL:: textureFormat() helpers for converting PixelFormat / CompressedPixelFormat to GL:: TextureFormat, similar to GL:: hasPixelFormat() / GL:: pixelFormat() used for converting to GL:: PixelFormat
Math library
- Math::
Frustum:: begin() / Math:: Frustum:: end() accessors for easy range-for access to Math:: Frustum planes - New Math::
Matrix4:: perspectiveProjection(const Vector2<T>&, const Vector2<T>&, T, T) overload for calculating off-center projection matrices - Color3ub and Color4ub can be printed with Corrade::
Utility:: Debug as actual colors using the Corrade:: Utility:: Debug:: color modifier - Added convenience
BoolVector2
,BoolVector3
andBoolVector4
typedefs to the root namespace - New Math::
IsScalar, Math:: IsVector, Math:: IsIntegral, Math:: IsFloatingPoint and Math:: IsUnitless type traits and a Math:: UnderlyingTypeOf utility - Added batch versions of Math::
isInf() and Math:: isNan() - Scalar and vector Math::
equal() and Math:: notEqual() which do a component-wise comparison in the vector case, as the equality/non-equality operators return a single bool
- Math::
scatter() as an inverse operation to Math:: gather(), both functions now support addressing via component indices as well - Added Math::
Matrix:: cofactor(), Math:: Matrix:: comatrix() and a new Math:: Matrix4:: normalMatrix() accessor that implements a faster and more robust normal matrix calculation; and mainly for testing purposes exposed Math:: Matrix:: adjugate() that was an internal part of Math:: Matrix:: inverted() before
MeshTools library
- MeshTools::
duplicateInto() alternative to MeshTools:: duplicate() that writes the output to an existing location - MeshTools::
generateFlatNormalsInto() alternative to MeshTools:: generateFlatNormals() that writes the output to an existing location - MeshTools::
generateSmoothNormals() for generating weighted smooth normals of indexed meshes (see mosra/ magnum#229) MeshTools::compile(const Trade::MeshData3D&, CompileFlags)
now accepts optional flags to control normal generation
Platform libraries
- Added Platform::
EmscriptenApplication, implementing a lightweight and more flexible alternative to Platform:: Sdl2Application for Emscripten. This is now the recommended application to use for WebGL builds. See mosra/ magnum#300 and mosra/ magnum-bootstrap#17. - Platform::
Sdl2Application and Platform:: GlfwApplication are now DPI-aware on Windows as well. See their documentation, HiDPI support, mosra/ magnum#243 and mosra/ magnum#349 for more information. - Added Platform::
Sdl2Application:: glContext() to access the underlying SDL_GLContext
(see mosra/magnum#325) - Added Platform::
Sdl2Application:: setMinWindowSize() and Platform:: Sdl2Application:: setMinWindowSize() + equivalent APIs for Platform:: GlfwApplication (see mosra/ magnum#335) - New base-wxwidgets bootstrap project for using Magnum together with wxWidgets (see mosra/
magnum-bootstrap#19) - Added Platform::
Sdl2Application:: setWindowTitle() (and equivalents in Platform:: GlfwApplication and Platform:: EmscriptenApplication) for changing window title at runtime as opposed to setting them on application startup - Added Platform::
Sdl2Application:: Configuration:: WindowFlag:: OpenGL and WindowFlag:: Vulkan, meant to be used together with Platform:: Sdl2Application:: Configuration:: WindowFlag:: Contextless for manual creation of OpenGL contexts and Vulkan instances - Platform::
WindowlessEglApplication now uses the EGL_ EXT_ device_ enumeration, EGL_ EXT_ platform_ base and EGL_ EXT_ platform_ device extensions where available instead of EGL_DEFAULT_DISPLAY
, working better on headless setups and allowing selection of an arbitrary GPU device on multi-GPU systems
Primitives library
- Primitives::
circle2DSolid() and Primitives:: circle3DSolid() can now generate a textured mesh
SceneGraph library
- Added SceneGraph::
AbstractObject:: Type / SceneGraph:: AbstractFeature:: Type / SceneGraph:: AbstractFeatureGroup:: Type typedefs and SceneGraph:: AbstractObject:: Dimensions / SceneGraph:: AbstractFeature:: Dimensions / SceneGraph:: AbstractFeatureGroup:: Dimensions constants for querying underlying type and dimension template parameters
Shaders library
- Normal texture support in
Shaders::Phong
- Added
Shaders::Generic3D::Tangent
generic vertex attribute definition - Object ID output in
Shaders::Flat
andShaders::Phong
- Vertex color support in
Shaders::Flat
andShaders::Phong
Text library
- A new Text::
AbstractGlyphCache base now makes Text:: AbstractFont and Text:: AbstractFontConverter independent on the graphics API used, meaning the Text library now has just an optional dependency on GL. The Text:: Renderer, Text::GlyphCache
andText::DistanceFieldGlyphCache
classes are now built only ifTARGET_GL
is enabled (done by default). - New Text::
AbstractFont:: setFileCallback() to allow opening multi-file fonts with an API similar to Trade:: AbstractImporter
Trade library
- The magnum-imageconverter utility now implements new
-i
/--importer-options
and-c
/--converter-options
command-line options for setting plugin-specific configuration
Changes and improvements
- The ResourceManager class now accepts also Corrade::
Containers:: Pointer instances in addition to raw pointers - The AbstractResourceLoader::
set() function now accepts also nullptr
for explicitly setting ResourceDataState::Loading or ResourceDataState:: NotFound resources - Added comparison operators to Resource (see mosra/
magnum#346) - ImageView and CompressedImageView of smaller dimension count are now implicitly convertible to views of higher dimension count to make slice-by-slice uploads to GL::
TextureArray and others easier - Image::
data(), CompressedImage:: data() and Trade:: ImageData:: data() called on a r-value now return Corrade:: Containers:: Array instead of being deleted - Global state used by GL::
Context and Audio:: Context is no longer duplicated when Magnum is built statically and linked to more than one dynamic library or executable. This works on all platforms except for Python bindings on Windows at the moment, where the workaround is to build both Corrade and Magnum dynamically. - The base-qt bootstrap project is fixed to use OpenGL 4.1 on macOS instead of being stuck on 2.1 (see mosra/
magnum-bootstrap#22) - Since asm.js days are long over and WebAssembly supports 64-bit integers natively, the UnsignedLong and Long types are now exposed on Emscripten as well
Animation library
- Default extrapolation of Animation::
TrackView was changed from Animation:: Extrapolation:: Extrapolated to Animation:: Extrapolation:: Constant to be consistent with Animation:: Track
Audio library
- The AnyAudioImporter plugin now correctly recognizes also uppercase file extensions (see mosra/
magnum#312)
DebugTools library
- DebugTools::
CompareImage, DebugTools:: CompareImageToFile and other variants are now usable directly through CORRADE_ COMPARE_ AS(), no need to pass an explicit instance to CORRADE_ COMPARE_ WITH() when just the default parameters are needed - DebugTools::
textureSubImage() for float textures was updated to work with SwiftShader (which has broken gl_VertexID
)
GL library
- Fully dropped support for EXT_
direct_ state_ access. All contemporary drivers supporting EXT_ direct_ state_ access support the (newer and better designed) ARB_ direct_ state_ access, while drivers that don't support the ARB version don't support the EXT flavor either. See also mosra/ magnum#81. - Reworked GL::
Mesh internals to make use of ARB_ direct_ state_ access instead of being the last code path stuck on EXT_ direct_ state_ access - GL::
DebugOutput:: setCallback() no longer assumes the debug message callback is called from the same thread as the one with the corresponding GL context (which is the case on Mesa AMD drivers). The documentation was updated to reflect that as well. - GL::
*Texture:: unbindImage() now uses a RGBA format instead of a single-channel format because ARM Mali drivers complain about R8 not being renderable (even though the format shouldn't matter when unbinding a texture) - The engine was silently doing an explicit initial call to glViewport() when it detected it's running under ApiTrace, because otherwise ApiTrace would assume a zero-sized framebuffer. This behavior is no longer silent but advertised as a
"apitrace-zero-initial-viewport"
workaround. See Driver workarounds for more information. - GL::
OpenGLTester no longer implicitly enables GL:: DebugOutput as it can be quite spammy when complex shaders or benchmarks are allowed. For easier debugging, users are encouraged to use the new --magnum-gpu-validation
command line option instead. - Added an ability to create GL::
DynamicAttribute directly from a GL:: Attribute
Math library
Math::BoolVector
now implements component-wise&&
,||
and!
for better consistency with boolean operations done on scalar types- Construction using Math::
ZeroInit and Math:: IdentityInit is now explicit, to be consistent with Math:: NoInit construction and avoid ambiguous cases - All scalar/vector functions in the Math namespace now work also with special types such as Deg or Rad — the only exception is power functions such as Math::
sqrt() or Math:: log(), as the resulting unit can't be represented. Those accept only unitless types. - All batch functions in Magnum/
Math/ FunctionsBatch.h now accept Corrade:: Containers:: StridedArrayView instead of a dense array view to make them usable in more contexts - Math::
Vector:: min(), Math:: Vector:: max(), Math:: Vector:: minmax() and batch Math:: min(const Containers:: StridedArrayView1D<const T>&), Math:: max(const Containers:: StridedArrayView1D<const T>&) and Math:: minmax(const Containers:: StridedArrayView1D<const T>&) functions now ignore NaNs in the data, if possible. Use Math:: isNan(const Vector<size, T>&) or the batch Math:: isNan(const Containers:: StridedArrayView1D<const T>&) to detect presence of NaN values if needed. - Changed the way
Math::operator<<(Corrade::Utility::Debug&, const BoolVector<size>&)
works — the output now has the same bit order as when constructing it using binary literals - Math::
sincos() now uses the __builtin_sincos
intrinsic on GCC, making it potentially faster in case the optimizer doesn't figure out the same - Math::
Vector:: operator-() and Math:: Vector2:: perpendicular() are now enabled only for signed types to prevent accidents
MeshTools library
- MeshTools::
fullScreenTriangle() was updated to work on ES3 SwiftShader contexts (which have broken gl_VertexID
) - MeshTools::
interleave() and MeshTools:: interleaveInto() now works also with Corrade:: Containers:: ArrayView, Corrade:: Containers:: StridedArrayView and friends
Shaders library
- All shaders now have rendering output tests, making them more robust for future additions and refactorings. See also mosra/
magnum#382. Shaders::Phong
now clamps the specular factor to minimize artifacts when shininess is near zeroShaders::Phong
can now handle zero lights, in which case its output is equivalent toShaders::Flat3D
. See Zero lights for more information.Shaders::MeshVisualizer
is fixed to work properly on Intel Windows drivers, adding a new"intel-windows-explicit-uniform-location-is-less-explicit-than-you-hoped"
workaround
TextureTools library
TextureTools::DistanceField
was updated to work on ES3 SwiftShader contexts (which have brokengl_VertexID
)
Platform libraries
- Platform::
Sdl2Application:: anyEvent() is now fired also for window events that are not exposed through viewportEvent() or exitEvent() - On OpenGL ES builds, Platform::
Sdl2Application now tells SDL whether to use a system GL driver or a dedicated GLES driver based on whether MAGNUM_TARGET_DESKTOP_GLES
is defined. This allows for a smoother experience for example when using ANGLE on Windows. See OpenGL ES specifics for more information. - Replaced uses of
Pointer_stringify()
in Platform::Sdl2Application which was removed in Emscripten 1.38.27 - Platform::
Sdl2Application and all Emscripten markup was updated to work correctly both with the -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
option available since Emscripten 1.38.27 and with older versions - Platform::
WindowlessEglApplication was adapted to properly create WebGL 2 contexts both in Emscripten 1.38.24 and in older versions - Platform::
Sdl2Application:: exit() and Platform:: GlfwApplication:: exit() now have an optional parameter to specify the actual application return code (see mosra/ magnum#332) - Platform::
Sdl2Application:: mainLoopIteration() now returns a bool
to indicate if the application should exit - Platform::
GlfwApplication, Platform:: EmscriptenApplication and Platform:: AndroidApplication now implement Platform:: GlfwApplication:: MouseMoveEvent:: relativePosition() as well for better compatibility with Platform:: Sdl2Application. The relative position is not supplied by the underlying toolkits, so it's emulated on the application side. - Extended Platform::
BasicScreen with mouseScrollEvent(), textInputEvent() and textEditingEvent() on application implementations that provide such events - Platform::
BasicScreenedApplication is now available also for Platform:: AndroidApplication - New Platform::
BasicScreen:: BasicScreen(BasicScreenedApplication<Application>&, PropagatedEvents) constructor that directly adds the newly-created screen to an application in a RAII manner, without needing to explicitly call Platform:: BasicScreenedApplication:: addScreen() and Platform:: BasicScreen:: setPropagatedEvents() later - Platform::
BasicScreen:: application() now returns a reference instead of a pointer, checking that the screen is actually added to the application. Users are encouraged to call Platform:: BasicScreen:: hasApplication() to check if the application is accessible.
Text library
- For consistency with Trade::
AbstractImporter, Text:: AbstractFont now doesn't fail when opening empty files — instead this is handled in the particular plugin implementations - Text::
AbstractFont:: size(), Text:: AbstractFont:: ascent(), Text:: AbstractFont:: descent() and Text:: AbstractFont:: lineHeight() now expect that a font is opened, consistently with other accessor functions
Trade library
- The AnyImageImporter, AnyImageConverter and AnySceneImporter plugins now correctly recognize also uppercase file extensions (see mosra/
magnum#312) - TgaImporter now properly reports an error message when opening an empty file
- Trade::
AbstractImporter:: setFileCallback() now accepts callbacks with const
references to user data as well - AnyImageImporter and AnyImageConverter plugins now recognize Basis Universal files (see mosra/
magnum#370)
Build system
- MSYS2 packages are now in official repositories, installable directly via
pacman
- Plugin search path on Windows is now discovered relative to location of the Trade, Text or Audio library DLL instead of executable location. That makes it behave better in case Magnum is installed via a package and the installation directory hardcoded at build time doesn't exist on the target machine (which is the case of MSYS2 packages).
FindSDL2.cmake
was updated to work with MinGW version 2.0.5 and newer, since these dropped the old directory hierarchy. Older versions have both the original and the new hierarchy, so it should work with these as well.- When using Magnum as a CMake subproject, Platform::
GlfwApplication and Platform:: Sdl2Application now copy the GLFW / SDL2 DLLs to CMAKE_RUNTIME_OUTPUT_DIRECTORY
(if set) as a post-build step. The DLL location, if found, is also available throughGLFW_DLL
andSDL2_DLL_RELEASE
/SDL2_DLL_DEBUG
variables for use by 3rd party code. See also mosra/magnum#347 for more information. - Updated extremely outdated Emscripten boilerplate from the base-emscripten bootstrap project (the HTML markup was unchanged since 2013, heh)
- ES 2.0 and ES 3.0 subset of tests requiring GL context is now run on Travis CI using SwiftShader for better code coverage (see mosra/
magnum#207) - On CMake 3.13 and up, WebGL2 build on Emscripten (and the
-s USE_WEBGL2=1
flag in particular) is now handled by theFindOpenGLES3.cmake
module and the newINTERFACE_LINK_OPTIONS
property instead ofFindMagnum.cmake
. On older versions this is handled inFindMagnum.cmake
by modifying the globalCMAKE_EXE_LINKER_FLAGS
variable. - It's now possible to use Magnum as a CMake subproject also when building for Emscripten (see mosra/
magnum#219) - Updated the Vcpkg package to work correctly with Vcpkg's own SDL2 (see Microsoft/
vcpkg#5730) - Updated bundled GL headers to properly define the
GL_VERSION_*
macros to avoid conflictingGLintptr
andGLsizeiptr
type definitions on Windows when using Magnum together with Qt - It's now possible to override CMake's OpenGL_
GL_ PREFERENCE from outside on systems where GLVND doesn't work properly (before the build scripts and FindMagnum.cmake
always forced GLVND) FindMagnum.cmake
now correctly finds debug versions of statically built plugins when using VcpkgFindEGL.cmake
,FindOpenAL.cmake
,FindOpenGLES2.cmake
andFindOpenGLES3.cmake
now explicitly link to theGL
andopenal
libraries on Emscripten, which is needed forMINIMAL_BUILD
FindOpenGLES2.cmake
andFindOpenGLES3.cmake
don't require GL ES headers to be installed on the system anymore, as Magnum uses its own copies- Fixed linking of static
Any*
plugins when the libraries are otherwise build as dynamic - Removed mention of the outdated Ubuntu PPA from Downloading and building as it doesn't seem to be maintained anymore (see mosra/
magnum-examples#61) - Worked around a bug in the NVCC compiler on Windows involving Math::
RectangularMatrix:: DiagonalSize to make Magnum usable with CUDA (see mosra/ magnum#345) - Fixed a 64-to-32-bit conversion warning on MSVC in GL::
Mesh internals (see mosra/ magnum#352) - Emscripten builds now have the
-fPIC
option disabled by default as it causes linker errors related to__memory_base
on 1.38.36 (see also emscripten-core/emscripten#8761) Fixed the
Magnum::Application
,Magnum::WindowlessApplication
andMagnum::GLContext
aliases inFindMagnum.cmake
to propagate the values from the target they alias also across directories, instead of failing with e.g.Error evaluating generator expression: $<TARGET_PROPERTY:Magnum::Sdl2Application,INTERFACE_INCLUDE_DIRECTORIES> Target "Magnum::Sdl2Application" not found.
Bug fixes
- Fixed compilation of the Vk library on 32-bit Windows
- Math::
pack() was incorrectly not selecting the nearest integral value, causing Math:: Color3:: toSrgbInt() to not roundtrip, among other things. - The
android_create_apk()
macro for Gradle-less Android builds now properly creates the library output directory beforehand - Fixed a bad interaction of GL::
Mesh and GL:: Buffer state trackers resulting in corrupted rendering on ES/WebGL platforms and systems without ARB_ direct_ state_ access - Fixed GL::
Mesh instanced drawing to properly take into account all five ANGLE_ instanced_ arrays, EXT_ instanced_ arrays, EXT_ draw_ instanced, NV_ instanced_ arrays and NV_ draw_ instanced extensions - Platform::
GLContext would crash on destruction if it was constructed with NoCreate but Platform:: GLContext:: create() was never called (see mosra/ magnum#331 - Reading of float textures on ES3 contexts using DebugTools::
textureSubImage() returned a zero-sized image by accident - MeshTools::
compile() was producing an incorrect mesh when Trade::MeshData
had both colors and texture coordinates - Properly zero-initializing the UTF-8 buffer in Platform::
GlfwApplication:: textInputEvent() (see mosra/ magnum#324) - Platform::
Sdl2Application:: viewportEvent() and Platform:: GlfwApplication:: viewportEvent() is fixed to behave correctly with Retina-aware apps on macOS/iOS - Text::
AbstractFontConverter:: exportFontToFile() and Text:: AbstractFontConverter:: exportGlyphCacheToFile() now properly returns failure when the underlying data export function returns an empty list of files - Updated the
base-qt
bootstrap project to correctly reset state tracker when going from and back to Qt code, and to use the framebuffer provided by Qt instead of GL::defaultFramebuffer (see mosra/ magnum#322 and mosra/ magnum-bootstrap#15) - TgaImporter now properly handles files with too short data (see mosra/
magnum#359) - When context creation fails really bad with Platform::
Sdl2Application, Platform:: GlfwApplication, Platform:: WindowlessGlxApplication or Platform:: WindowlessWglApplication, driver detection for the "no-forward-compatible-core-context"
now properly handles glGetString() returning anullptr
- GL::
Texture:: imageSize() was present on WebGL 2 by mistake (see mosra/ magnum#365) - GL::
BufferTexture:: setBuffer() now creates the passed buffer if not already (and if it was not created by glCreateBuffers()). Before that, passing a freshly created GL:: Buffer to it was causing GL:: Renderer:: Error:: InvalidOperation on systems without ARB_ direct_ state_ access. - Fixed
Shaders::Vector
andShaders::DistanceFieldVector
to work on iOS, which has only 8 texture binding slots in total (see mosra/magnum-examples#65 and mosra/ magnum#374)
Documentation
- Extended Emscripten documentation with available compiler switches for code size / compile time tradeoffs (instead of unconditionally enabling them by default, see mosra/
magnum#211) - Fixed Gentoo build instructions (see mosra/
magnum#344) - Various documentation improvements and copy editing (see mosra/
magnum#341, mosra/ magnum#361) - Populating the Troubleshooting section of Windows-specific platform notes (see mosra/
magnum#355) - Extended info about the
--head
option in Vcpkg package (see mosra/magnum#367) - The Getting Started Guide was rewritten to be easier to follow for Windows users, removing usual pain points (see mosra/
magnum#377 and mosra/ magnum#378)
Deprecated APIs
Math::Color3::Hsv
andMath::Color4::Hsv
tuple typedefs are deprecated in favor of tuple-less Math::ColorHsv, working correctly with the usual Math:: NoInit / Math:: ZeroInit tags while being faster to compile Math::Frustum::planes()
are deprecated due to redundancy, use either Math::Frustum:: operator[](), Math:: Frustum:: data() or range access using Math:: Frustum:: begin() / Math:: Frustum:: end() - Batch Math::
min(const Containers:: StridedArrayView1D<const T>&), Math:: max(const Containers:: StridedArrayView1D<const T>&) and Math:: minmax(const Containers:: StridedArrayView1D<const T>&) are moved to a new Magnum/ Math/ FunctionsBatch.h header in order to speed up compile times. This header is included from Magnum/ Math/ FunctionsBatch.h when building with MAGNUM_ BUILD_ DEPRECATED enabled, include it explicitly to ensure forward compatibility Trade::ImporterFileCallbackPolicy
is deprecated as it was moved to InputFileCallbackPolicy in the root namespace to be shared with APIs outside of the Trade namespace. Moreover,InputFileCallbackPolicy::LoadPernament
is deprecated due to a typo, use InputFileCallbackPolicy::LoadPermanent instead. DebugTools::ForceRendererOptions::scale()
is deprecated in favor of DebugTools::ForceRendererOptions:: size(), as that's more consistent with the documentation and the corresponding setter. Text::AbstractFont::openSingleData()
andText::AbstractFont::openData()
taking a list of files are deprecated in favor of Text::AbstractFont:: openData(Containers:: ArrayView<const void>, Float) and Text:: AbstractFont:: setFileCallback() - GL::
Buffer:: setData() and GL:: Buffer:: setSubData() no longer has overloads taking std:: vector / std:: array, but instead relies on Corrade/ Containers/ ArrayViewStl.h to provide conversion from these to Corrade:: Containers:: ArrayView. This header is included automatically when MAGNUM_ BUILD_ DEPRECATED is enabled, include it explicitly to stay forward compatible. GL::TextureFormat::R3B3G2
had a misleading typo in the name, use GL::TextureFormat:: R3G3B2 instead. - GL::
AbstractTexture destructor is now protected
on builds with MAGNUM_BUILD_ DEPRECATED disabled in order to avoid accidents with subclass destructors not being called. Right now all subclasses themselves have trivial destruction, but that may change in the future due to driver workarounds being added. Magnum/MeshTools/GenerateFlatNormals.h
is deprecated, use Magnum/MeshTools/ GenerateNormals.h instead MeshTools::generateFlatNormals(const std::vector<UnsignedInt>&, const std::vector<Vector3>&)
is deprecated for doing too many things at once and being too tied to one particular STL container, use MeshTools::generateFlatNormals(const Containers:: StridedArrayView1D<const Vector3>&) instead - Templated versions of Image::
data(), ImageView:: data(), CompressedImage:: data(), CompressedImageView:: data() and Trade:: ImageData:: data() that returned a raw pointer are deprecated, use the non-templated version together with Corrade:: Containers:: arrayCast() instead for properly bounds-checked type conversion - Passing
nullptr
to ImageView constructors is deprecated and will print a warning at runtime. Use a constructor without thedata
parameter instead. - The
ResourceManager::instance()
singleton (and its implicit use in DebugTools::ForceRenderer and DebugTools:: ObjectRenderer) is deprecated as it makes some use cases harder than they should be. Make your own singleton or explicitly pass a ResourceManager reference around instead. - Platform::
BasicScreen:: application() now returns a reference instead of a pointer and together with Platform:: BasicScreen:: redraw() checks that the screen is actually added to the application instead of returning nullptr
(and requiring excessive error checking in user code) or, in case of redraw() silently doing the wrong thing. For backwards compatibility Platform::BasicScreenedApplication is convertible to a pointer and implements operator->
, but this conversion is deprecated. Math::swizzle()
is deprecated, use Math::gather() instead as that fits better with the new Math:: scatter()
Potential compatibility breakages, removed APIs
- Configuration value parsers and writers for Math types were moved to a dedicated Magnum/
Math/ ConfigurationValue.h header in order to speed up compile times. Backwards compatibility is not provided, when using Math types with Corrade:: Utility:: Configuration or Corrade:: Utility:: Arguments you have to include the header explicitly - Audio::
Extension:: extensions() and GL:: Extension:: extensions() now return a Corrade:: Containers:: ArrayView instead of a reference to std:: vector in order to reduce binary bloat and compile times - Removed all aliases to GL library functionality in the root namespace (and root include path) which were deprecated in 2018.04 and everything related to this change:
GL::Mesh::IndexType
andGL::Mesh::indexSize()
, use GL::MeshIndexType and GL::Mesh::indexTypeSize()
instead
- Removed
Primitives::Capsule2D
,Primitives::Capsule3D
,Primitives::Circle
,Primitives::Crosshair2D
,Primitives::Crosshair3D
,Primitives::Cube
,Primitives::Cylinder
,Primitives::Icosphere
,Primitives::Line
,Primitives::Plane
,Primitives::Square
andPrimitives::UVSphere
classes deprecated in 2018.04. The same functionality is available through free functions in the Primitives namespace, use those instead. - Removed templated overloads of GL::
Buffer:: data(), GL:: Buffer:: subData() and GL:: Buffer:: map() deprecated since 2017. Use the non-templated versions together with Corrade:: Containers:: arrayCast(). - Removed
GL::Context::DetectedDriver::AMD
andGL::Context::DetectedDriver::ProbablyAngle
aliases deprecated since 2017, use consistently-named GL::Context:: DetectedDriver:: Amd and GL:: Context:: DetectedDriver:: Angle instead - Removed
GL::CubeMapTexture::Coordinate
deprecated since 2016, use GL::CubeMapCoordinate instead - Removed remaining Platform::
*Application constructors taking nullptr
instead of NoCreate, deprecated since 2017 - Removed compatibility code in Audio::
Context where Audio:: Context:: current() would be usable with both .
and->
, deprecated since 2017 - Removed
Audio::Context::hrtfSpecifier()
deprecated since 2018.02. Use Audio::Context:: hrtfSpecifierString() instead. - Removed the
Shapes
library together withDebugTools::ShapeRenderer
, which was a failed design experiment deprecated since version 2018.10 (see mosra/magnum#148) - Removed the
Platform::GlutApplication
as it was based on an outdated toolkit and deprecated since version 2018.10 (see mosra/magnum#148 and mosra/ magnum#195) - In order to be compatible with both Emscripten 1.38.27 and the versions before, all Emscripten markup is now expected to have the HTML
<canvas>
element identified by#canvas
. You need to:- update your HTML markup to use
<canvas id="canvas">
instead of<canvas id="module">
- in case you have a copy or a fork of the JS driver file, it needs to define
Module.canvas
asdocument.getElementById('canvas')
(instead of'module'
) - and for CSS files, all references to
#module
need to be#canvas
now
- update your HTML markup to use
- The
BUILD_MULTITHREADED
CMake option andMAGNUM_BUILD_MULTITHREADED
CMake / preprocessor variable has been moved to Corrade — you need to toggle it when building Corrade and use CORRADE_BUILD_ MULTITHREADED instead - PixelFormat and CompressedPixelFormat now reserve the zero value to indicate an invalid format, better catching accidentally forgotten initialization. Valid code shouldn't be affected by this change, but broken code that seemingly worked before might start throwing assertions now.
Shaders::MeshVisualizer
now asserts if its wireframe-related setters are called when theShaders::MeshVisualizer::Flag::Wireframe
flag was not set, consistently with other shaders. This might cause failures in code that was calling them unnecessarily before.
2019.01
Released 2019-02-04, tagged as v2019.01.
Dependency changes
- Minimal supported GCC version is now 4.8.1, GCC 4.7 is not supported anymore. Minimal Clang version is now 3.3, since that's the first version with a complete C++11 support. See also mosra/
magnum#274. - Minimal supported CMake version is now 3.1. Older versions are not supported anymore and all workarounds for them were removed. Download a prebuilt release of a newer version if you need to use Corrade on older systems (such as Ubuntu 14.04 or Debian 8). See also mosra/
magnum#274.
New features
Animation library
- New Animation::
Easing namespace with a collection of well-documented easing functions - New Animation::
ease(), Animation:: easeClamped(), Animation:: unpack(), Animation:: unpackEase() and Animation:: unpackEaseClamped() utilities for combining interpolators with easing functions and/or unpackers - Animation::
Player:: resume() that acts the same as play() except it doesn't restart the animation from the start if it is already playing - Added Animation::
Player:: advance(T, std:: initializer_list<Containers:: Reference<Player<T, K>>>) for advancing multiple players at the same time
Math library
- Support for using the Math::
Deg, Math:: Rad, Math:: Half, Math:: Color3 and Math:: Color4 literals with the new experimental Corrade:: Utility:: Tweakable utility. See also Tweakable literal parsers. - New Math::
StrictWeakOrdering functor making it possible to use Magnum math types as keys in ordered STL containers such as std:: map or std:: set (see also mosra/ magnum#299)
Platform libraries
- Added Platform::
AndroidApplication:: framebufferSize(), Platform:: AndroidApplication:: dpiScaling(), Platform:: AndroidApplication:: ViewportEvent:: dpiScaling(), Platform:: GlfwApplication:: ViewportEvent:: framebufferSize() and Platform:: GlfwApplication:: ViewportEvent:: dpiScaling() to ensure feature parity with Platform:: Sdl2Application - Clarified HiDPI behavior of Android apps and mentioning the necessary steps in the docs
- Implemented handling of Platform::
AndroidApplication:: viewportEvent() and documenting how to get Android to call it instead of relaunching the app from scratch - New Platform::
Sdl2Application:: exitEvent() and Platform:: GlfwApplication:: exitEvent() events for responding to application window close and possibility to cancel it (for example to show an exit confirmation dialog) - New Platform::
Sdl2Application:: anyEvent() event together with event() accessors to make it possible to access raw SDL_Event
data
Vk library
- Conversion between Magnum math types and math-related Vulkan types in a new Magnum/
Vk/ Integration.h header
Changes and improvements
Audio library
- Audio::
Source:: play(), Audio:: Source:: pause(), Audio:: Source:: rewind() and Audio:: Source:: stop() now return a self-reference like all other methods for easier method chaining
GL library
- Added a
"nv-egl-incorrect-gl11-function-pointers"
workaround that explicitly loads OpenGL 1.0 and 1.1 function pointers on contexts created using EGL on NVidia drivers, because there functions such as glGetString() behave incorrectly when linked statically. See also mosra/magnum#308. - New GL::
Context:: State:: BindScratchVao state to make external OpenGL code that's not VAO-aware working on core GL profiles (which don't allow default VAOs being used for drawing)
Platform libraries
- Platform::
Sdl2Application:: swapBuffers(), "Platform::*Application::swapBuffers()" swapInterval() const const, setSwapInterval(), setMinimalLoopPeriod() and redraw() were changed from protected to public to allow calling them from outside
Text library
- The Text::
AbstractFont and Text:: AbstractFontConverter plugin APIs now return Corrade:: Containers:: Pointer instead of std:: unique_ptr for improved compile times
TextureTools library
- Further performance and output quality improvements for
TextureTools::DistanceField
, making the ES2/WebGL 1 consistent with desktop and speeding up the processing to take only 60% of the time compared to before. It's now also possible to reuse the internal state for batch processing.
Trade library
- The Trade::
AbstractImporter plugin API now returns Corrade:: Containers:: Pointer instead of std:: unique_ptr for improved compile times
Build system
- Experimental support for creating Android APKs directly using CMake without Gradle involved. See Building and installing graphics apps for more information. See also mosra/
toolchains#5 and mosra/ toolchains#6. - Initial scaffolding for Hunter package support (see mosra/
magnum#298) - The
package/msys
directory now containsPKGBUILD
s for MSYS2. See MSYS2 packages for more information. See also mosra/magnum#307. - The
Magnum::AndroidApplication
target was missing a few dependency libraries when Magnum was used as a CMake subproject - Fixed an ambiguous overload error in
Text::GlyphCache
when compiling this library under C++17 (see mosra/magnum#297) - Imroved initial Emscripten setup on Windows to be more frictionless (see mosra/
toolchains#4) - DebugTools no longer unconditionally requires the Trade library in case Corrade::
TestSuite is found. The DebugTools:: CompareImage documentation was updated to mention the optionality.
Bug fixes
- Fixed Platform::
Sdl2Application and Platform:: GlfwApplication to properly support the $MAGNUM_DPI_SCALING
environment variable as an alternative to--magnum-dpi-scaling
command-line parameter. It was also not documented anywhere. Besides that, the default--magnum-dpi-scaling
value should have beendefault
as documented, notvirtual
. - Don't assert in DPI scaling detection in Platform::
Sdl2Application and Platform:: GlfwApplication on X11 DEs that don't create any RESOURCE_MANAGER
(see mosra/magnum#290) - Properly escaping log output on Emscripten Platform::
WindowlessEglApplication - The GL::
Context:: States enum set was missing value combining operators - Fixed
Text::DistanceFieldGlyphCache
internal formats on ES2 devices that support EXT_texture_ storage (see mosra/ magnum#289) - PixelStorage::
imageHeight() and Z value of PixelStorage:: skip() was not properly handled on ES3 / WebGL 2 builds.
Documentation
- Fixed various broken links (see mosra/
magnum#291) - A dedicated Integration with types from the STL and 3rd party APIs section listing all provided integrations with 3rd party math APIs
Deprecated APIs
- All uses of std::
unique_ptr in Text:: AbstractFont, Text:: AbstractFontConverter and Trade:: AbstractImporter are replaced with Corrade:: Containers:: Pointer. The types are implicitly move-convertible to each other if the Corrade/ Containers/ PointerStl.h header is included. The header is included where needed if MAGNUM_ BUILD_ DEPRECATED is enabled. To ensure your code keeps with future versions of Magnum, either switch your code to use Corrade:: Containers:: Pointer as well or include the Corrade/ Containers/ PointerStl.h header explicitly. TextureTools::distanceField()
is deprecated due to inefficiency of its statelessness when doing batch processing. Use theTextureTools::DistanceField
class instead.Platform::GlfwApplication::KeyEvent::Key::Smicolon
has a typo and so is deprecated in favor of Platform::GlfwApplication:: KeyEvent:: Key:: Semicolon
Potential compatibility breakages, removed APIs
- The MeshTools::
fullScreenTriangle() function now returns just a GL:: Mesh instead of std:: pair of a mesh and a buffer, as the buffer is now owned by the mesh. This change was not possible to be done in a backwards-compatible way. - Animation::
Player, Audio:: Listener, GL:: AbstractShaderProgram, GL:: MeshView and GL:: Shader APIs that take a std:: initializer_list of references were changed to use Corrade:: Containers:: Reference instead of a std:: reference_wrapper. This change should be fully transparent to the user as the type conversion is done implicitly in both cases, but you may need to add an #include <Corrade/Containers/Reference.h>
where appropriate. - Removed deprecated implicit conversion Corrade::
Containers:: Optional to std:: optional, deprecated in January 2018. The class now contains an explicit and opt-in STL compatibility, see its documentation for more information. You may need to add an #include <Corrade/Containers/Optional.h>
where appropriate. - Removed the
Magnum/Test/AbstractOpenGLTester.h
header that was deprecated in January 2017. Use Magnum/GL/ OpenGLTester.h and the GL:: OpenGLTester library instead. Note that the deprecated Magnum/OpenGLTester.h
header is still present, along with all other deprecated GL-specific headers and APIs in the project root. - Removed five-argument
Trade::MeshData2D
and six-argumentTrade::MeshData3D
constructors that were deprecated since February- Use the full six/seven-argument versions instead.
- Removed Platform application constructors taking
nullptr
, deprecated in June 2016 for windowless apps and in March 2017 for windowed apps. Use constructors taking the NoCreate tag instead. - Removed availability of Math::
Color3 and Math:: Color4 literals in the root namespace, deprecated since April 2016. Explicitly call using namespace Math::Literals;
instead. - Removed uppercase
*HSV
APIs from Math::Color3 and Math:: Color4, deprecated since December 2016. Use the CamelCased *Hsv
APIs instead. - Removed
Math::normalize()
andMath::denormalize()
functions, deprecated since December 2016. Use Math::pack() and Math:: unpack() instead. - Removed
Platform::*Application::MouseEvent::Button::WheelUp
andPlatform::*Application::MouseEvent::Button::WheelDown
, deprecated since June 2016. Use the dedicated mouseScrollEvent() API instead. - Removed
Platform::GlfwApplication::Configuration::WindowFlag::Resizeable
, deprecated since February 2017. Use Platform::GlfwApplication:: Configuration:: WindowFlag:: Resizable instead. - Removed
MAGNUM_*_LIBRARIES
andMAGNUM_*_INCLUDE_DIRS
CMake variables, which were deprecated in favor ofMagnum::*
imported targets in February 2016.
2018.10
Released 2018-10-23, tagged as v2018.10.
New features
Animation library
- New experimental Animation library for keyframe-based animation playback (see mosra/
magnum#191, mosra/ magnum#267)
DebugTools library
- New DebugTools::
CompareImageFile, DebugTools:: CompareImageToFile and DebugTools:: CompareFileToImage comparators extending DebugTools:: CompareImage with convenient image file loading
GL library
- Exposing GL::
Context:: Flag:: ForwardCompatible through GL:: Context:: flags(), which was deliberately ignored before. - New GL::
Renderer:: lineWidthRange() limit query. The reported maximum can be over 1.0f
only in non-forward-compatible contexts, a new"mesa-forward-compatible-line-width-range"
workaround fixes that for Mesa. See Driver workarounds for more information. - Implemented the ARB_
sample_ shading desktop extension and the equivalent functionality in OpenGL ES 3.2 / OES_ sample_ shading ES3 extension
Math library
- New Math::
CubicHermite class for cubic Hermite spline interpolation, convertible to and from cubic Bézier curves using Math:: Bezier:: fromCubicHermite() and Math:: CubicHermite:: fromBezier() (see mosra/ magnum#267) - Added Math::
Intersection:: rangeFrustum(), Math:: Intersection:: aabbFrustum(), Math:: Intersection:: sphereFrustum(), Math:: Intersection:: pointCone(), Math:: Intersection:: pointDoubleCone(), Math:: Intersection:: sphereConeView(), Math:: Intersection:: sphereCone(), Math:: Intersection:: aabbCone(), Math:: Intersection:: rangeCone() (see mosra/ magnum#226) - Added Math::
Matrix3:: rotationShear(), Math:: Matrix4:: rotationShear(), Math:: Matrix3:: scalingSquared(), Math:: Matrix4:: scalingSquared(), Math:: Matrix3:: scaling() const and Math:: Matrix4:: scaling() const getters for extracting further properties from the rotation/scaling part of a matrix - Added Math::
Color3:: fromSrgb(UnsignedInt), Math:: Color4:: fromSrgbAlpha(UnsignedInt), Math:: Color4:: fromSrgb(UnsignedInt, T), Math:: Color3:: toSrgbInt(), and Math:: Color4:: toSrgbAlphaInt() for easier conversion of packed 24-/32-bit sRGB colors to and from Math:: Color3 / Math:: Color4 - Added Math::
lerp(const Complex<T>&, const Complex<T>&, T) and Math:: slerp(const Complex<T>&, const Complex<T>&, T) for feature parity with Math:: Quaternion - Added Math::
lerpShortestPath(const Quaternion<T>&, const Quaternion<T>&, T), Math:: slerpShortestPath(const Quaternion<T>&, const Quaternion<T>&, T) and Math:: sclerpShortestPath(const DualQuaternion<T>&, const DualQuaternion<T>&, T) variants; clarified that the original versions are explicitly not shortest-path - Added Math::
Range2D:: x(), Math:: Range3D:: x(), Math:: Range2D:: y(), Math:: Range3D:: y(), Math:: Range3D:: z() and Math:: Range3D:: xy() for slicing ranges into lower dimensions - Added Math::
intersect() and Math:: intersects() as a counterpart to Math:: join() for operating with Math:: Range instances - Added Math::
Range:: contains() overloading taking a range, in addition to vector - Added Math::
Range:: fromCenter() and documented a hint how to create integral centered ranges - Added Math::
Range:: scaledFromCenter() as a counterpart to Math:: Range:: scaled() - Math::
Range is now constructible from a std:: pair of values, making it usable in combination with Math:: minmax(), for example - Added Math::
Constants:: piQuarter(), Math:: Constants:: sqrtHalf() - Added a convenience function Math::
select() as a constant interpolation counterpart to Math:: lerp() - Added a convenience function Math::
planeEquation() to aid with passing passing parameters to Math:: Intersection:: planeLine(), Math:: Distance:: pointPlane() and others - Ability to convert
Math::BoolVector
from and to external representation - Ability to construct Math::
Matrix from a smaller or larger square matrix by slicing or expanding it - Mutable overloads for Math::
Complex:: real(), Math:: Complex:: imaginary(), Math:: Dual:: real(), Math:: Dual:: dual(), Math:: Quaternion:: vector() and Math:: Quaternion:: scalar() - Ability to do a component-wise multiply and divide of Math::
Complex and a Math:: Vector2, in addition to multiplication/division with a scalar - Ability to use Math::
Complex, Math:: DualComplex, Math:: Quaternion, Math:: DualQuaternion with Corrade:: Utility:: Configuration and Corrade:: Utility:: Arguments - Added Math::
Complex:: data(), Math:: Quaternion:: data(), Math:: DualComplex:: data(), Math:: DualQuaternion:: data(), Math:: Bezier:: data() and Math:: CubicHermite:: data() for simple access to underlying memory like with other math types - New Math::
min(), Math:: max() and Math:: minmax() overloads taking plain C arrays - Vector overloads for Math::
isInf() and Math:: isNan()
Platform libraries
- Initial HiDPI support for Linux and Emscripten in Platform::
Sdl2Application and Platform:: GlfwApplication - Implemented missing resize event support in Platform::
Sdl2Application on Emscripten - Ability to modify CSS classes that control layout of Emscripten app canvas using Platform::
Sdl2Application:: setContainerCssClass() - Implemented Platform::
GlfwApplication:: MouseMoveEvent:: buttons() for feature parity with Platform:: Sdl2Application (see mosra/ magnum#256) - Added Platform::
Sdl2Application:: MouseScrollEvent:: position() and Platform:: GlfwApplication:: MouseScrollEvent:: position() - Added GLConfiguration::
setColorBufferSize(), GLConfiguration:: setDepthBufferSize(), GLConfiguration:: setStencilBufferSize(), to Platform:: Sdl2Application, Platform:: GlfwApplication and Platform:: AndroidApplication. This also makes the default framebuffer parameters consistent across the implementations. - Added numpad keys to Platform::
Sdl2Application:: KeyEvent:: Key, consistent with GLFW key mapping - Exposed enabled-by-default GLConfiguration::
Flag:: ForwardCompatible flag in Platform:: Sdl2Application and Platform:: GlfwApplication, added GLConfiguration:: addFlags() and GLConfiguration:: clearFlags() for easier flag handling - Exposed enabled-by-default Configuration::
Flag:: ForwardCompatible flag in Platform:: WindowlessEglApplication, Platform:: WindowlessGlxApplication and Platform:: WindowlessWglApplication, added Configuration:: addFlags() and Configuration:: clearFlags() for easier flag handling
Primitives library
- New Primitives::
gradient2D(), Primitives:: gradient2DHorizontal(), Primitives:: gradient2DVertical(), Primitives:: gradient3D(), Primitives:: gradient3DHorizontal() and Primitives:: gradient3DVertical() primitives - New Primitives::
line2D(const Vector2&, const Vector2&) and Primitives:: line3D(const Vector3&, const Vector3&) overloads for easier creation of arbitrary lines, as transforming the line identities is not worth the mental overhead
SceneGraph library
- New SceneGraph::
TranslationRotationScalingTransformation2D and SceneGraph:: TranslationRotationScalingTransformation3D transformation implementations that store separate translation, rotation and scaling parameters for easier use with animated scenes - Ability to affect order of items drawn by SceneGraph::
Camera — see Custom draw order and object culling for more information
Shaders library
- New dedicated
Shaders::VertexColor::Color3
andShaders::VertexColor::Color4
attribute specifiers for more convenient distinction between three- and four-component vertex color attribute. - Support for multiple lights in
Shaders::Phong
- Classical alpha masking support in
Shaders::Flat
andShaders::Phong
- Debug output for the
Shaders::Flat::Flag
/Shaders::Flat::Flags
,Shaders::MeshVisualizer::Flag
/Shaders::MeshVisualizer::Flags
andShaders::Phong::Flag
/Shaders::Phong::Flags
enums / enum sets
Trade library
- Trade::
AnimationData class and animation import interface in Trade:: AbstractImporter:: animation() and related functions - New
Trade::AbstractMaterialData::flags()
,Trade::AbstractMaterialData::alphaMode()
andTrade::AbstractMaterialData::alphaMask()
material properties - New Trade::
CameraData:: type(), Trade:: CameraData:: aspectRatio() and Trade:: CameraData:: size() properties, ability to describe 2D cameras Trade::ObjectData2D
andTrade::ObjectData3D
now support also separate translation / rotation / scaling specification instead of a combined transformation matrix. SeeTrade::ObjectData2D::transformation()
andTrade::ObjectData3D::transformation()
for more information.- Support for file loading callbacks in Trade::
AbstractImporter - Debug output for
Trade::AbstractImporter::Feature
,Trade::AbstractImageConverter::Feature
enums andTrade::AbstractImporter::Features
,Trade::AbstractImageConverter::Features
enum sets - AnyImageImporter plugin now supports detection and loading of DDS, EXR, HDR, JPEG, PNG and TGA files from data next to file type detection based on filename
- AnyImageConverter learned detection of JPEG output
- AnySceneImporter gained support for animation import
Vk library
- New Vk library that'll be the home of a Vulkan graphics backend in the future
- New functions
Vk::hasVkPrimitiveTopology()
,Vk::vkPrimitiveTopology()
,Vk::hasVkIndexType()
,Vk::vkIndexType()
,Vk::hasVkFormat()
,Vk::vkFormat()
,Vk::vkFilter()
,Vk::vkSamplerMipmapMode()
,Vk::hasVkSamplerAddressMode()
,Vk::vkSamplerAddressMode()
for converting generic MeshPrimitive, MeshIndexType, PixelFormat, CompressedPixelFormat, SamplerFilter, SamplerMipmap and SamplerWrapping enums to Vulkan-specific values
Changes and improvements
Audio library
- Ability to specify initial source direction using Audio::
Playable:: Playable(SceneGraph:: AbstractObject<dimensions, Float>&, const VectorTypeFor<dimensions, Float>&, PlayableGroup<dimensions>*)
GL library
- To prevent nothing being rendered by accident, GL::
Mesh:: setCount() and GL:: MeshView:: setCount() now has always to be called, even just to set the count to 0
. - GL::
Mesh:: addVertexBuffer(), GL:: Mesh:: addVertexBufferInstanced() GL:: Mesh:: setIndexBuffer() can now take ownership of a passed GL:: Buffer to simplify resource management on user side. See Transferring buffer ownership for more information. GL::Mesh::draw()
andGL::MeshView::draw()
now return a reference to self to make method-chained draws (for example using a different shader) possible as well- The GL::
BufferUsage parameter in GL:: Buffer:: setData() is now optional, defaults to GL:: BufferUsage:: StaticDraw
Math library
- All assertions in the Math namespace now helpfully print the offending value that caused the assert for easier debugging
- Math::
Matrix3:: rotation() const and Math:: Matrix4:: rotation() const now allow non-uniform scaling, but expect the roation/scaling part to be orthogonal after normalization - Math::
angle(), Math:: Vector:: lengthInverted(), Math:: Vector:: normalized(), Math:: Vector:: resized(), Math:: Vector:: projected(), Math:: Vector:: projectedOntoNormalized() and Math:: Vector2:: aspectRatio() are now enabled only for floating-point types to avoid errors when using these functions accidentally on integral vectors (see mosra/ magnum#251)
MeshTools library
- MeshTools::
compile() API got simplified to make use of the new buffer ownership feature of GL:: Mesh - MeshTools::
compile() learned to handle vertex color attributes as well (see mosra/ magnum#284)
Platform libraries
- Platform::
*Application:: viewportEvent() now gets all information needed for DPI-aware rendering instead of just a framebuffer size — now also window size and the DPI scaling value - Overhauled the builtin Emscripten HTML markup and styling for HTML5/WebGL apps:
- the builtin style now matches the dark theme of the Magnum website
- canvas is responsively sized and preserves aspect ratio when scaled down
- when the app aborts, a helpful message is printed instead of everything getting stuck
- it's possible to override the default canvas size and aspect ratio, see Modifying page style, canvas size and aspect ratio
- documentation explaining quirks of event handling, see Controlling event behavior
- Platform::
GlfwApplication now behaves the same as Platform:: Sdl2Application when creating an OpenGL context: first it attempts to create a forward-compatible core OpenGL 3.2+ context and if that fails, falls back to 2.1+ compatibility context. The "no-forward-compatible-core-context"
workaround is implemented as well, see Driver workarounds for more information. - Platform::
GlfwApplication no longer stores a needless global window pointer - Platform::
GlfwApplication now loads modifiers for mouse move and mouse scroll events lazily, only when needed - Platform::
Screen:: viewportEvent() is no longer pure virtual to be consistent with all *Application
implementations - Platform::
Sdl2Application now defaults to the actual canvas size on Emscripten, instead of hardcoded {640, 480}
- Platform::
Sdl2Application:: Configuration:: WindowFlags values that make no sense on Emscripten are not available there anymore - When using SDL 2.0.8 and newer, Platform::
Sdl2Application no longer attempts to disable compositing on Linux. See Linux specifics for more information. See also mosra/ magnum#184. - New
"swiftshader-no-empty-egl-context-flags"
and"swiftshader-egl-context-needs-pbuffer"
workarounds to make Platform::WindowlessEglApplication working with SwiftShader. See Driver workarounds for more information.
Shaders library
- All shaders now have reasonable default values for uniforms in order to further simplify and remove friction from quick prototyping use cases
Shaders::Flat::bindTexture()
,Shaders::Phong::bindAmbientTexture()
,Shaders::Phong::bindDiffuseTexture()
,Shaders::Phong::bindSpecularTexture()
andShaders::Phong::bindTextures()
now assert that the shader was created with the corresponding flag enabled to prevent accidental "black screen of death" errors.- Ambient color in untextured
Shaders::Phong
now defaults to0x00000000_rgbaf
in order to support alpha-masked drawing out of the box
TextureTools library
- Fixed
TextureTools::distanceField()
to not require more than 8 texture units, which is the limit on all iOS ES2 contexts, independently on the device (ES3 contexts have 16).
Trade library
- Trade::
PhongMaterialData now contains well-defined color values instead of random memory after construction
Build system
- There's now a PPA for Ubuntu packages. See Packages for Debian, Ubuntu and derivatives for more information. See also mosra/
magnum#248 and mosra/ magnum#249. - Fixed various issues preventing to build and use the base libraries with OpenGL support disabled (see mosra/
magnum#255) - Magnum now links to GLVND on Linux instead of the old libGL ABI if using CMake 3.11 and newer
- Using official Apple OpenGL include paths on iOS (see mosra/
magnum#253) - FindMagnum.cmake now allows to use the DebugTools library even if some of its optional dependencies are not compiled in
FindSDL2.cmake
now properly links todl
andpthread
libraries when using a static build of SDL2 on LinuxFindSDL2.cmake
is now able to properly find a debug build of SDL, which enables Vcpkg to properly copy all dependency DLLs on Windows (see mosra/magnum-examples#42, mosra/ magnum-examples#45) FindGLFW.cmake
is now preferring GLFW CMake config file to pick up the imported target, if available (see mosra/magnum#194) FindMagnum.cmake
now provides full paths to application JS/CSS files on Emscripten builds through newMAGNUM_EMSCRIPTENAPPLICATION_JS
,MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS
andMAGNUM_WEBAPPLICATION_CSS
CMake variables. These files are now installed unconditionally even if noPlatform::*Application
library is built to allow them to be used with third-party application implementations.- ObjImporter didn't work with CMake subprojects due to an embarrassing typo (see mosra/
magnum#259) - AnyAudioImporter, AnyImageConverter, AnyImageImporter and AnySceneImporter plugins were not correctly updated for subproject support after moving them out of the
magnum-plugins
repository - Improved out-of-the-box behavior with Emscripten toolchains (see mosra/
magnum#283)
Bug fixes
- MSVC 15.8 (released on Aug 14, 2018) has a regression causing the compiler to crash with an ICE (C1001) on Math::
Color4 constructors that have a default alpha parameter. This is only only when the /permissive-
flag is specified (which is done by default for projects created directly using Visual Studio but not for projects using CMake). This has been worked around, but can't be guaranteed it was the only case. In case you're experiencing a similar issue somewhere else, please try to disable the/permissive-
flag first. - An assert was firing during Platform::
GlfwApplication initialization due to a pointer not being properly initialized after the GLConfiguration rework in 2018.04 (see mosra/ magnum#246, mosra/ magnum#247) - Vertex attribute divisor in GL::
Mesh:: addVertexBufferInstanced() was not properly cleaned up after when ARB_ vertex_ array_ object was disabled, causing subsequent draws to misbehave - Fixed
Shaders::DistanceFieldVector
andShaders::Vector
to be properly movable - Restored backwards compatibility to the templated GL::
Buffer:: map() overload — it was not possible to call it with void
template parameter - ARB_
direct_ state_ access versions of GL:: Framebuffer:: clearColor(), GL:: Framebuffer:: clearDepth(), GL:: Framebuffer:: clearStencil() and GL:: Framebuffer:: clearDepthStencil() were binding the framebuffer for drawing, which was completely unnecessary - Deprecation status of GL-specific values of the generic MeshPrimitive enum was not properly reflected in the documentation
- Platform::
GlfwApplication:: InputEvent:: Modifier:: Super is properly reported for both left and right modifier (Windows/⌘) key instead of just the right one - Platform::
GlfwApplication:: exec() now asserts instead of crashing if the constructor fails to create a window (see mosra/ magnum#192, mosra/ magnum#272) - Platform::
GlfwApplication:: GLConfiguration:: isSrgbCapable() has now a proper documented default value instead of being left uninitialized. - Math::
sclerp() was not properly interpolating the translation if rotation was the same on both sides - Improved
TextureTools::distanceField()
to work better on shader compilers that have problems compiling nested loops (WebGL implementations, some ES2 devices) - SceneGraph::
AbstractObject:: addFeature() and SceneGraph:: Object:: addChild() were not properly forwarding reference arguments
Documentation
- New Using Magnum with custom buildsystems page listing the most important things to keep in mind when using Magnum with custom buildsystems. See also mosra/
magnum#268. - Compiled code snippets for Audio and SceneGraph libraries, fixing cases where outdated or plain wrong API constructs were mentioned
- Extended documentation for Math::
Matrix3:: rotation(), Math:: Matrix4:: rotation() and related accessors, explaining use cases and caveats - Reworked documentation of Math::
Algorithms, adding math equations and usage examples to all functions - Improved documentation of Math::
Constants, showing useful identities for each - The Using the scene graph documentation was proofread and extended with a section covering basics with visual diagrams.
- Explicitly mentioning copy/move constructibility for all classes with non-trivial construction
- Improved Vcpkg build instructions (see mosra/
magnum#271, mosra/ magnum#273) - Website styling got out of sync with generated Doxygen documentation, causing search icon to either disappear on some browsers or be extremely oversized on others (see mosra/
magnum#260, mosra/ magnum#261) - Documentation of Primitives and Shaders namespaces now has proper sRGB and HiDPi renderings of all primitives and shaders
- Various other fixes and updates (see mosra/
magnum#281)
Deprecated APIs
- The
Shapes
library is a failed design experiment and is scheduled for removal in a future release, together withDebugTools::ShapeRenderer
. Related geometry algorithms were moved to Math::Distance and Math:: Intersection; if you need a full-fledged physics library, please have look at Bullet, which has Magnum integration in BulletIntegration, or at Box2D, which has a Magnum example as well. Platform::GlutApplication
is based on an outdated toolkit and thus scheduled for removal in a future release. Please consider switching to Platform::Sdl2Application or Platform:: GlfwApplication as soon as possible. Platform::*ApplicationviewportEvent(const Vector2i&)
is deprecated because it doesn't provide all information needed for DPI-aware rendering. Override the viewportEvent(ViewportEvent&) function instead.Platform::Sdl2Application::Configuration::WindowFlags::AllowHighDpi
is deprecated and has no effect as it is now passed implicitly on platforms that need itMath::Geometry
,Math::Geometry::Distance
andMath::Geometry::Intersection
namespaces are deprecated for being too deeply nested, use Math::Distance and Math:: Intersection instead Math::Geometry::Intersection::boxFrustum()
is deprecated, use Math::Intersection:: rangeFrustum() instead - Math::
Intersection:: planeLine() taking a separate plane normal and position is deprecated, use Math:: planeEquation() and the overload taking a plane equation as Math:: Vector4 instead Audio::PlayableGroup::setClean()
is deprecated in favor of Audio::Listener:: update(), as that one is a feature superset with clearer naming - MeshTools::
compile() taking a GL:: BufferUsage and returning a tuple was deprecated, use the simpler version taking just Trade::MeshData2D
/Trade::MeshData3D
and directly returning a GL::Mesh instead Shaders::VertexColor::Color
is deprecated, use the directShaders::VertexColor::Color3
orShaders::VertexColor::Color4
alternatives insteadTrade::AbstractMaterialData
constructor taking just two parameters and Trade::PhongMaterialData constructor taking three parameters are deprecated, use Trade::AbstractMaterialData::AbstractMaterialData(MaterialType, Flags, MaterialAlphaMode, Float, const void*)
andTrade::PhongMaterialData::PhongMaterialData(Flags, MaterialAlphaMode, Float, Float, const void*)
instead- Trade::
CameraData constructor not taking an explicit type enum is deprecated, use Trade:: CameraData:: CameraData(CameraType, Rad, Float, Float, Float, const void*) instead GL::*Texture::setSRGBDecode()
,GL::Renderer::Feature::FramebufferSRGB
,Platform::*Application::GLConfiguration::setSRGBCapable()
andPlatform::*Application::GLConfiguration::isSRGBCapable()
is deprecated, use GL::*Texture:: setSrgbDecode(), GL:: Renderer:: Feature:: FramebufferSrgb, Platform:: *Application:: GLConfiguration:: setSrgbCapable() and Platform:: *Application:: GLConfiguration:: isSrgbCapable() instead as it has consistent naming with Math:: Color APIs
Potential compatibility breakages, removed APIs
- The
Shapes
library is not built by default anymore due to its deprecated status - Audio::
Playable is now by default omnidirectional instead of having source in direction of negative Z axis (the direction has effect only when setting inner and outer cone properties of Audio:: Source). - Math::
Matrix3:: rotation() const and Math:: Matrix4:: rotation() const now allow non-uniform scaling, but expect the roation/scaling part to be orthogonal after normalization (before it required uniform scaling but not orthogonal axes) — this might cause imprecise data that were previously working to fail with an assertion. See the new Math:: Matrix3:: rotationShear() and Math:: Matrix4:: rotationShear() accessors for a possible solution. - Since one-dimensional Math::
Range is now used on many new places such as the Animation library, its underlying type is just T
instead of Math::Vector<1, T> to make it easier to use. This may break rare existing code that was using one-dimensional ranges or generic code that's always expecting a vector type. See Use in generic code for possible solutions. - SceneGraph::
Camera:: setViewport() and SceneGraph:: Camera:: draw() are no longer virtual
functions. If you need to override their functionality, simply call the subclass implementation directly instead of calling it through a SceneGraph::Camera. Shaders::Flat::bindTexture()
,Shaders::Phong::bindAmbientTexture()
,Shaders::Phong::bindDiffuseTexture()
,Shaders::Phong::bindSpecularTexture()
andShaders::Phong::bindTextures()
now assert that the shader was created with the corresponding flag enabled to prevent accidental "black screen of death" errors. This might cause your application to abort if it was calling these functions when not needed.- Ambient color in untextured
Shaders::Phong
now defaults to0x00000000_rgbaf
in order to support alpha-masked drawing out of the box. This may break code that assumed the alpha channel being opaque by default. - Trade::
PhongMaterialData:: ambientColor(), diffuseColor() and specularColor() now return Color4 instead of Color3 - Applications now expose GL context forward compatibility as an enabled-by-default context flag. Calling Platform::
*Application:: GLConfiguration:: setFlags() (and similarly on windowless apps) will reset that flag, use Platform:: *Application:: GLConfiguration:: addFlags() (And similarly on windowless apps) to preserve the enabled-by-default flags.
Changelogs for previous versions are available in Archived changelogs.