Magnum::Shaders::ProjectionUniform2D struct new in Git master

2D projection uniform common for all shaders

Contains the per-view projection matrix.

Constructors, destructors, conversion operators

ProjectionUniform2D(DefaultInitT = DefaultInit) explicit constexpr noexcept
Construct with default parameters.
ProjectionUniform2D(NoInitT) explicit noexcept
Construct without initializing the contents.

Public variables

Matrix3x4 projectionMatrix
Projection matrix.

Convenience setters

Provided to allow the use of method chaining for populating a structure in a single expression, otherwise equivalent to accessing the fields directly. Also guaranteed to provide backwards compatibility when packing of the actual fields changes.

auto setProjectionMatrix(const Matrix3& matrix) -> ProjectionUniform2D&
Set the projectionMatrix field.

Function documentation

ProjectionUniform2D& Magnum::Shaders::ProjectionUniform2D::setProjectionMatrix(const Matrix3& matrix)

Set the projectionMatrix field.

Returns Reference to self (for method chaining)

The matrix is expanded to Matrix3x4, with the bottom row being zeros.

Variable documentation

Matrix3x4 Magnum::Shaders::ProjectionUniform2D::projectionMatrix

Projection matrix.

Default value is an identity matrix (i.e., an orthographic projection of the default $ [ -\boldsymbol{1} ; \boldsymbol{1} ] $ cube). The bottom row is unused and acts only as a padding to match uniform buffer packing rules.