Magnum/Magnum.h file

Forward declarations and basic types for the Magnum namespace.

Namespaces

namespace Magnum
Root namespace.

Typedefs

using Debug = Corrade::Utility::Debug
Alias for debug output.
using Warning = Corrade::Utility::Warning
Alias for warning output.
using Error = Corrade::Utility::Error
Alias for error output.
using Fatal = Corrade::Utility::Fatal
Alias for fatal output.

Defines

#define MAGNUM_BUILD_DEPRECATED
Build with deprecated features included.
#define MAGNUM_BUILD_STATIC
Static library build.
#define MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS new in 2020.06
Static library build with globals unique across shared libraries.
#define MAGNUM_BUILD_MULTITHREADED deprecated in 2019.10
Multi-threaded build.
#define MAGNUM_TARGET_GL
OpenGL interoperability.
#define MAGNUM_TARGET_GLES
OpenGL ES target.
#define MAGNUM_TARGET_WEBGL
WebGL target.
#define MAGNUM_TARGET_GLES2
OpenGL ES 2.0 / WebGL 1.0 target.
#define MAGNUM_TARGET_GLES3 deprecated in Git master
OpenGL ES 3.0+ / WebGL 2.0 target.
#define MAGNUM_TARGET_EGL new in Git master
EGL target.
#define MAGNUM_TARGET_HEADLESS deprecated in Git master
Headless target.
#define MAGNUM_TARGET_DESKTOP_GLES deprecated in Git master
OpenGL ES target on GLX / WGL.
#define MAGNUM_TARGET_VK
Vulkan interoperability.

Basic type definitions

See Math type system for more information.

using UnsignedByte = std::uint8_t
Unsigned byte (8bit)
using Byte = std::int8_t
Signed byte (8bit)
using UnsignedShort = std::uint16_t
Unsigned short (16bit)
using Short = std::int16_t
Signed short (16bit)
using UnsignedInt = std::uint32_t
Unsigned int (32bit)
using Int = std::int32_t
Signed int (32bit)
using UnsignedLong = std::uint64_t
Unsigned long (64bit)
using Long = std::int64_t
Signed long (64bit)
using Float = float
Float (32bit)
using Half = Math::Half
Half (16bit)
using BitVector2 = Math::BitVector<2> new in Git master
Two-component vector of bits.
using BitVector3 = Math::BitVector<3> new in Git master
Three-component vector of bits.
using BitVector4 = Math::BitVector<4> new in Git master
Four-component vector of bits.
using BoolVector2 = BitVector2 deprecated in Git master
Two-component vector of bits.
using BoolVector3 = BitVector3 deprecated in Git master
Three-component vector of bits.
using BoolVector4 = BitVector4 deprecated in Git master
Four-component vector of bits.
using Vector2 = Math::Vector2<Float>
Two-component float vector.
using Vector3 = Math::Vector3<Float>
Three-component float vector.
using Vector4 = Math::Vector4<Float>
Four-component float vector.
using Vector2ub = Math::Vector2<UnsignedByte> new in 2020.06
Two-component unsigned byte vector.
using Vector3ub = Math::Vector3<UnsignedByte> new in 2020.06
Three-component unsigned byte vector.
using Vector4ub = Math::Vector4<UnsignedByte> new in 2020.06
Four-component unsigned byte vector.
using Vector2b = Math::Vector2<Byte> new in 2020.06
Two-component signed byte vector.
using Vector3b = Math::Vector3<Byte> new in 2020.06
Three-component signed byte vector.
using Vector4b = Math::Vector4<Byte> new in 2020.06
Four-component signed byte vector.
using Vector2us = Math::Vector2<UnsignedShort> new in 2020.06
Two-component unsigned short vector.
using Vector3us = Math::Vector3<UnsignedShort> new in 2020.06
Three-component unsigned short vector.
using Vector4us = Math::Vector4<UnsignedShort> new in 2020.06
Four-component unsigned short vector.
using Vector2s = Math::Vector2<Short> new in 2020.06
Two-component signed short vector.
using Vector3s = Math::Vector3<Short> new in 2020.06
Three-component signed short vector.
using Vector4s = Math::Vector4<Short> new in 2020.06
Four-component signed short vector.
using Vector2ui = Math::Vector2<UnsignedInt>
Two-component unsigned integer vector.
using Vector3ui = Math::Vector3<UnsignedInt>
Three-component unsigned integer vector.
using Vector4ui = Math::Vector4<UnsignedInt>
Four-component unsigned integer vector.
using Vector2i = Math::Vector2<Int>
Two-component signed integer vector.
using Vector3i = Math::Vector3<Int>
Three-component signed integer vector.
using Vector4i = Math::Vector4<Int>
Four-component signed integer vector.
using Color3 = Math::Color3<Float>
Three-component (RGB) float color.
using Color4 = Math::Color4<Float>
Four-component (RGBA) float color.
using ColorHsv = Math::ColorHsv<Float>
HSV float color.
using Color3ub = Math::Color3<UnsignedByte>
Three-component (RGB) unsigned byte color.
using Color3us = Math::Color3<UnsignedShort> new in 2020.06
Three-component (RGB) unsigned short color.
using Color4ub = Math::Color4<UnsignedByte>
Four-component (RGBA) unsigned byte color.
using Color4us = Math::Color4<UnsignedShort> new in 2020.06
Four-component (RGB) unsigned short color.
using Matrix2x1 = Math::Matrix2x1<Float> new in Git master
Float matrix with 2 columns and 1 row.
using Matrix2x2 = Math::Matrix2x2<Float>
2x2 float matrix
using Matrix2x3 = Math::Matrix2x3<Float>
Float matrix with 2 columns and 3 rows.
using Matrix2x4 = Math::Matrix2x4<Float>
Float matrix with 2 columns and 4 rows.
using Matrix3x1 = Math::Matrix3x1<Float> new in Git master
Float matrix with 3 columns and 1 row.
using Matrix3x2 = Math::Matrix3x2<Float>
Float matrix with 3 columns and 2 rows.
using Matrix3x3 = Math::Matrix3x3<Float>
3x3 float matrix
using Matrix3x4 = Math::Matrix3x4<Float>
Float matrix with 3 columns and 4 rows.
using Matrix4x1 = Math::Matrix4x1<Float> new in Git master
Float matrix with 4 columns and 1 row.
using Matrix4x2 = Math::Matrix4x2<Float>
Float matrix with 4 columns and 2 rows.
using Matrix4x3 = Math::Matrix4x3<Float>
Float matrix with 4 columns and 3 rows.
using Matrix4x4 = Math::Matrix4x4<Float>
4x4 float matrix
using Matrix3 = Math::Matrix3<Float>
3x3 float transformation matrix
using Matrix4 = Math::Matrix4<Float>
4x4 float transformation matrix
using Matrix2x2b = Math::Matrix2x2<Byte> new in 2020.06
Signed byte matrix with 2 columns and 2 rows.
using Matrix2x3b = Math::Matrix2x3<Byte> new in 2020.06
Signed byte matrix with 2 columns and 3 rows.
using Matrix2x4b = Math::Matrix2x4<Byte> new in 2020.06
Signed byte matrix with 2 columns and 4 rows.
using Matrix3x2b = Math::Matrix3x2<Byte> new in 2020.06
Signed byte matrix with 3 columns and 2 rows.
using Matrix3x3b = Math::Matrix3x3<Byte> new in 2020.06
Signed byte matrix with 3 columns and 3 rows.
using Matrix3x4b = Math::Matrix3x4<Byte> new in 2020.06
Signed byte matrix with 3 columns and 4 rows.
using Matrix4x2b = Math::Matrix4x2<Byte> new in 2020.06
Signed byte matrix with 4 columns and 2 rows.
using Matrix4x3b = Math::Matrix4x3<Byte> new in 2020.06
Signed byte matrix with 4 columns and 3 rows.
using Matrix4x4b = Math::Matrix4x4<Byte> new in 2020.06
Signed byte matrix with 4 columns and 4 rows.
using Matrix2x2s = Math::Matrix2x2<Short> new in 2020.06
Signed short matrix with 2 columns and 2 rows.
using Matrix2x3s = Math::Matrix2x3<Short> new in 2020.06
Signed short matrix with 2 columns and 3 rows.
using Matrix2x4s = Math::Matrix2x4<Short> new in 2020.06
Signed short matrix with 2 columns and 4 rows.
using Matrix3x2s = Math::Matrix3x2<Short> new in 2020.06
Signed short matrix with 3 columns and 2 rows.
using Matrix3x3s = Math::Matrix3x3<Short> new in 2020.06
Signed short matrix with 3 columns and 3 rows.
using Matrix3x4s = Math::Matrix3x4<Short> new in 2020.06
Signed short matrix with 3 columns and 4 rows.
using Matrix4x2s = Math::Matrix4x2<Short> new in 2020.06
Signed short matrix with 4 columns and 2 rows.
using Matrix4x3s = Math::Matrix4x3<Short> new in 2020.06
Signed short matrix with 4 columns and 3 rows.
using Matrix4x4s = Math::Matrix4x4<Short> new in 2020.06
Signed short matrix with 4 columns and 4 rows.
using QuadraticBezier2D = Math::QuadraticBezier2D<Float>
Float two-dimensional quadratic Bézier curve.
using QuadraticBezier3D = Math::QuadraticBezier3D<Float>
Float three-dimensional quadratic Bézier curve.
using CubicBezier2D = Math::CubicBezier2D<Float>
Float two-dimensional cubic Bézier curve.
using CubicBezier3D = Math::CubicBezier3D<Float>
Float three-dimensional cubic Bézier curve.
using CubicHermite1D = Math::CubicHermite1D<Float>
Float scalar cubic Hermite spline point.
using CubicHermite2D = Math::CubicHermite2D<Float>
Float two-dimensional cubic Hermite spline point.
using CubicHermite3D = Math::CubicHermite3D<Float>
Float three-dimensional cubic Hermite spline point.
using CubicHermiteComplex = Math::CubicHermiteComplex<Float>
Float cubic Hermite spline complex number.
using CubicHermiteQuaternion = Math::CubicHermiteQuaternion<Float>
Float cubic Hermite spline quaternion.
using Complex = Math::Complex<Float>
Float complex number.
using DualComplex = Math::DualComplex<Float>
Float dual complex number.
using Quaternion = Math::Quaternion<Float>
Float quaternion.
using DualQuaternion = Math::DualQuaternion<Float>
Float dual quaternion.
using Constants = Math::Constants<Float>
Float constants.
using Deg = Math::Deg<Float>
Angle in float degrees.
using Rad = Math::Rad<Float>
Angle in float radians.
using Range1D = Math::Range1D<Float>
One-dimensional float range.
using Range2D = Math::Range2D<Float>
Two-dimensional float range.
using Range3D = Math::Range3D<Float>
Three-dimensional float range.
using Range1Dui = Math::Range1D<UnsignedInt> new in Git master
One-dimensional unsigned integer range.
using Range2Dui = Math::Range2D<UnsignedInt> new in Git master
Two-dimensional unsigned integer range.
using Range3Dui = Math::Range3D<UnsignedInt> new in Git master
Three-dimensional unsigned integer range.
using Range1Di = Math::Range1D<Int>
One-dimensional signed integer range.
using Range2Di = Math::Range2D<Int>
Two-dimensional signed integer range.
using Range3Di = Math::Range3D<Int>
Three-dimensional signed integer range.
using Frustum = Math::Frustum<Float>
Float frustum.
using Nanoseconds = Math::Nanoseconds<Long> new in Git master
64-bit signed integer nanoseconds
using Seconds = Math::Seconds<Float> new in Git master
32-bit float seconds

Half-precision types

These types are for storage and conversion from / to single-precision types, no arithmetic operations are implemented. See Math type system for more information, for performing arithmetic on these types use Math::unpackHalf() / Math::unpackHalfInto() to convert to a 32-bit float type first and then Math::packHalf() / Math::packHalfInto() back again.

using Vector2h = Math::Vector2<Half> new in 2020.06
Two-component half-float vector.
using Vector3h = Math::Vector3<Half> new in 2020.06
Three-component half-float vector.
using Vector4h = Math::Vector4<Half> new in 2020.06
Four-component half-float vector.
using Color3h = Math::Color3<Half> new in 2020.06
Three-component (RGB) half-float color.
using Color4h = Math::Color4<Half> new in 2020.06
Four-component (RGBA) half-float color.
using Matrix2x2h = Math::Matrix2x2<Half> new in 2020.06
Half-float matrix with 2 columns and 2 rows.
using Matrix2x3h = Math::Matrix2x3<Half> new in 2020.06
Half-float matrix with 2 columns and 3 rows.
using Matrix2x4h = Math::Matrix2x4<Half> new in 2020.06
Half-float matrix with 2 columns and 4 rows.
using Matrix3x2h = Math::Matrix3x2<Half> new in 2020.06
Half-float matrix with 3 columns and 2 rows.
using Matrix3x3h = Math::Matrix3x3<Half> new in 2020.06
Half-float matrix with 3 columns and 3 rows.
using Matrix3x4h = Math::Matrix3x4<Half> new in 2020.06
Half-float matrix with 3 columns and 4 rows.
using Matrix4x2h = Math::Matrix4x2<Half> new in 2020.06
Half-float matrix with 4 columns and 2 rows.
using Matrix4x3h = Math::Matrix4x3<Half> new in 2020.06
Half-float matrix with 4 columns and 3 rows.
using Matrix4x4h = Math::Matrix4x4<Half> new in 2020.06
Half-float matrix with 4 columns and 4 rows.
using Degh = Math::Deg<Half> new in Git master
Angle in half-float degrees.
using Radh = Math::Rad<Half> new in Git master
Angle in half-float radians.
using Range1Dh = Math::Range1D<Half> new in Git master
One-dimensional half-float range.
using Range2Dh = Math::Range2D<Half> new in Git master
Two-dimensional half-float range.
using Range3Dh = Math::Range3D<Half> new in Git master
Three-dimensional half-float range.

Double-precision types

See Math type system for more information.

using Double = double
Double (64bit)
using Vector2d = Math::Vector2<Double>
Two-component double vector.
using Vector3d = Math::Vector3<Double>
Three-component double vector.
using Vector4d = Math::Vector4<Double>
Four-component double vector.
using Matrix3d = Math::Matrix3<Double>
3x3 double transformation matrix
using Matrix4d = Math::Matrix4<Double>
4x4 double transformation matrix
using Matrix2x1d = Math::Matrix2x1<Double> new in Git master
Double matrix with 2 columns and 1 row.
using Matrix2x2d = Math::Matrix2x2<Double>
2x2 double matrix
using Matrix2x3d = Math::Matrix2x3<Double>
Double matrix with 2 columns and 3 rows.
using Matrix2x4d = Math::Matrix2x4<Double>
Double matrix with 2 columns and 4 rows.
using Matrix3x1d = Math::Matrix3x1<Double> new in Git master
Double matrix with 3 columns and 1 row.
using Matrix3x2d = Math::Matrix3x2<Double>
Double matrix with 3 columns and 2 rows.
using Matrix3x3d = Math::Matrix3x3<Double>
3x3 double matrix
using Matrix3x4d = Math::Matrix3x4<Double>
Double matrix with 3 columns and 4 rows.
using Matrix4x1d = Math::Matrix4x1<Double> new in Git master
Double matrix with 4 columns and 1 row.
using Matrix4x2d = Math::Matrix4x2<Double>
Double matrix with 4 columns and 2 rows.
using Matrix4x3d = Math::Matrix4x3<Double>
Double matrix with 4 columns and 3 rows.
using Matrix4x4d = Math::Matrix4x4<Double>
4x4 double matrix
using QuadraticBezier2Dd = Math::QuadraticBezier2D<Double>
Double two-dimensional quadratic Bézier curve.
using QuadraticBezier3Dd = Math::QuadraticBezier3D<Double>
Double three-dimensional quadratic Bézier curve.
using CubicBezier2Dd = Math::CubicBezier2D<Double>
Double two-dimensional cubic Bézier curve.
using CubicBezier3Dd = Math::CubicBezier3D<Double>
Double three-dimensional cubic Bézier curve.
using CubicHermite1Dd = Math::CubicHermite1D<Double>
Double scalar cubic Hermite spline point.
using CubicHermite2Dd = Math::CubicHermite2D<Double>
Double two-dimensional cubic Hermite spline point.
using CubicHermite3Dd = Math::CubicHermite3D<Double>
Double three-dimensional cubic Hermite spline point.
using CubicHermiteComplexd = Math::CubicHermiteComplex<Double>
Double cubic Hermite spline complex number.
using CubicHermiteQuaterniond = Math::CubicHermiteQuaternion<Double>
Double cubic Hermite spline quaternion.
using Complexd = Math::Complex<Double>
Double complex number.
using DualComplexd = Math::DualComplex<Double>
Double dual complex number.
using Quaterniond = Math::Quaternion<Double>
Double quaternion.
using DualQuaterniond = Math::DualQuaternion<Double>
Double dual quaternion.
using Constantsd = Math::Constants<Double>
Double constants.
using Degd = Math::Deg<Double>
Angle in double degrees.
using Radd = Math::Rad<Double>
Angle in double radians.
using Range1Dd = Math::Range1D<Double>
One-dimensional double range.
using Range2Dd = Math::Range2D<Double>
Two-dimensional double range.
using Range3Dd = Math::Range3D<Double>
Three-dimensional double range.
using Frustumd = Math::Frustum<Double>
Double frustum.

Define documentation

#define MAGNUM_BUILD_DEPRECATED

Build with deprecated features included.

Defined if the library contains deprecated features and APIs (which will be removed in the future). To preserve backward compatibility, Magnum is by default built with deprecated features included.

#define MAGNUM_BUILD_STATIC

Static library build.

Defined if built as static libraries. Default are shared libraries.

#define MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS new in 2020.06

Static library build with globals unique across shared libraries.

Enabled by default in a static build. On Windows see also the MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS_DLL_NAME CMake option.

#define MAGNUM_TARGET_GL

OpenGL interoperability.

Defined if the engine is built with OpenGL interoperability enabled — extra APIs in various libraries interacting with the GL library. Enabled by default in case the GL library is built.

#define MAGNUM_TARGET_GLES

OpenGL ES target.

Defined if the engine is built for OpenGL ES 3.0 or OpenGL ES 2.0.

#define MAGNUM_TARGET_WEBGL

WebGL target.

Defined if the engine is built for WebGL (using Emscripten). WebGL 1 is nearly equivalent to OpenGL ES 2.0 and WebGL 2 to OpenGL ES 3.0, thus in most cases you don't need to treat it differently, but there are some specific restrictions and differences compared to OpenGL ES 2.0 and to OpenGL ES 3.0 which you might want to be aware of. Implies also MAGNUM_TARGET_GLES.

#define MAGNUM_TARGET_GLES2

OpenGL ES 2.0 / WebGL 1.0 target.

Defined if the engine is built for OpenGL ES 2.0 / WebGL 1.0 instead of OpenGL ES 3.0+ / WebGL 2. Implies also MAGNUM_TARGET_GLES.

#define MAGNUM_TARGET_GLES3

OpenGL ES 3.0+ / WebGL 2.0 target.

#define MAGNUM_TARGET_EGL new in Git master

EGL target.

Defined if the engine is built for EGL instead of a platform-specific OpenGL support library like CGL, EAGL, GLX or WGL. When enabled, Platform::Sdl2Application and Platform::GlfwApplication will create the context using EGL, and command-line utilities like magnum-gl-info or magnum-distancefieldconverter as well as the GL::OpenGLTester library will use Platform::WindowlessEglApplication. Defined implicitly on iOS, Android, Emscripten and Windows RT.

#define MAGNUM_TARGET_HEADLESS

Headless target.

Alias to MAGNUM_TARGET_EGL, unless on iOS, Android, Emscripten or Windows RT.

#define MAGNUM_TARGET_DESKTOP_GLES

OpenGL ES target on GLX / WGL.

Defined if MAGNUM_TARGET_GLES is set but MAGNUM_TARGET_EGL isn't, unless on iOS, Android, Emscripten or Windows RT.

#define MAGNUM_TARGET_VK

Vulkan interoperability.

Defined if the engine is built with Vulkan interoperability enabled — extra APIs in various libraries interacting with the Vk library. Enabled by default in case the Vk library is built.