mirror of https://github.com/mosra/magnum.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
3.5 KiB
73 lines
3.5 KiB
|
13 years ago
|
namespace Magnum {
|
||
|
|
/** @page types Type system
|
||
|
|
|
||
|
|
@brief Type aliases, naming and compatibility with OpenGL and GLSL types
|
||
|
|
|
||
|
|
@section types-builtin Builtin types
|
||
|
|
|
||
|
|
%Magnum provides typedefs for builtin integral and floating-point arithmetic
|
||
|
|
types to ensure portability (e.g. Int is *always* 32bit), maintain consistency
|
||
|
|
and reduce confusion (e.g. `std::int32_t`, `int` and `GLint` all refer to the
|
||
|
|
same type).
|
||
|
|
|
||
|
|
| %Magnum type | Size | Equivalent GLSL type |
|
||
|
|
| ------------------ | -------------- | -------------------- |
|
||
|
|
| @ref UnsignedByte | 8bit unsigned | |
|
||
|
|
| @ref Byte | 8bit signed | |
|
||
|
|
| @ref UnsignedShort | 16bit unsigned | |
|
||
|
|
| @ref Short | 16bit signed | |
|
||
|
|
| @ref UnsignedInt | 32bit unsigned | `uint` |
|
||
|
|
| @ref Int | 32bit signed | `int` |
|
||
|
|
| @ref UnsignedLong | 64bit unsigned | |
|
||
|
|
| @ref Long | 64bit signed | |
|
||
|
|
| @ref Float | 32bit | `float` |
|
||
|
|
| @ref Double | 64bit | `double` |
|
||
|
|
|
||
|
|
Types not meant to be used in arithmetic (such as `bool` or `std::size_t`) or
|
||
|
|
types which cannot be directly passed to GLSL shaders (such as `long double`)
|
||
|
|
have no typedefs.
|
||
|
|
|
||
|
|
Types from the above table are then used to define other types. All following
|
||
|
|
types are aliases of corresponding types in Math namespace. No suffix after type
|
||
|
|
name means @ref Float underlying type, `ui` means @ref UnsignedInt underlying
|
||
|
|
type, `i` is @ref Int underlying type and `d` is for @ref Double underlying type.
|
||
|
|
|
||
|
|
@section types-matrix Matrix/vector types
|
||
|
|
|
||
|
|
| %Magnum vector type | Equivalent GLSL type |
|
||
|
|
| ---------------------------------------------- | ------------------------- |
|
||
|
|
| @ref Vector2, @ref Vector3, @ref Vector4 | `vec2`, `vec3`, `vec4` |
|
||
|
|
| @ref Vector2ui, @ref Vector3ui, @ref Vector4ui | `uvec2`, `uvec3`, `uvec4` |
|
||
|
|
| @ref Vector2i, @ref Vector3i, @ref Vector4i | `ivec2`, `ivec3`, `ivec4` |
|
||
|
|
| @ref Vector2d, @ref Vector3d, @ref Vector4d | `dvec2`, `dvec3`, `dvec4` |
|
||
|
|
|
||
|
|
| %Magnum matrix type | Equivalent GLSL type |
|
||
|
|
| --------------------------------- | ------------------------------------ |
|
||
|
|
| @ref Matrix2 or @ref Matrix2d | `mat2`/`mat2x2` or `dmat2`/`dmat2x2` |
|
||
|
|
| @ref Matrix3 or @ref Matrix3d | `mat3`/`mat3x3` or `dmat3`/`dmat3x3` |
|
||
|
|
| @ref Matrix4 or @ref Matrix4d | `mat4`/`mat4x4` or `dmat3`/`dmat4x4` |
|
||
|
|
| @ref Matrix2x3 or @ref Matrix2x3d | `mat2x3` or `dmat2x3` |
|
||
|
|
| @ref Matrix3x2 or @ref Matrix3x2d | `mat3x2` or `dmat3x2` |
|
||
|
|
| @ref Matrix2x4 or @ref Matrix2x4d | `mat2x4` or `dmat2x4` |
|
||
|
|
| @ref Matrix4x2 or @ref Matrix4x2d | `mat4x2` or `dmat4x2` |
|
||
|
|
| @ref Matrix3x4 or @ref Matrix3x4d | `mat3x4` or `dmat3x4` |
|
||
|
|
| @ref Matrix4x3 or @ref Matrix4x3d | `mat4x3` or `dmat4x3` |
|
||
|
|
|
||
|
|
Any super- or sub-class of the same size and underlying type can be used
|
||
|
|
equivalently (e.g. Math::Vector or Color3 instead of @ref Vector3).
|
||
|
|
|
||
|
|
@section types-other Other types
|
||
|
|
|
||
|
|
Other types, which don't have their GLSL equivalent, are:
|
||
|
|
|
||
|
|
- @ref Rectangle or @ref Rectanglei
|
||
|
|
- @ref Complex or @ref Complexd, @ref DualComplex or @ref DualComplexd
|
||
|
|
- @ref Quaternion or @ref Quaterniond, @ref DualQuaternion or @ref DualQuaterniond
|
||
|
|
|
||
|
|
These types can be used in GLSL either by extracting values from their
|
||
|
|
underlying structure or converting them to types supported by GLSL (e.g.
|
||
|
|
quaternion to matrix).
|
||
|
|
|
||
|
|
*/
|
||
|
|
}
|