Documentation for <wlr/types/wlr_matrix.h>

Back to index

Table of contents

wlr_matrix_identity()

void wlr_matrix_identity(​float mat[]);

Writes the identity matrix into mat

wlr_matrix_multiply()

void wlr_matrix_multiply(​float mat[], const float a[], const float b[]);

mat ← a × b

wlr_matrix_project_box()

void wlr_matrix_project_box(​float mat[], const struct wlr_box *box, enum wl_output_transform transform, float rotation, const float projection[]);

Shortcut for the various matrix operations involved in projecting the specified wlr_box onto a given orthographic projection with a given rotation. The result is written to mat, which can be applied to each coordinate of the box to get a new coordinate from [-1,1].

wlr_matrix_projection()

void wlr_matrix_projection(​float mat[], int width, int height, enum wl_output_transform transform);

Writes a 2D orthographic projection matrix to mat of (width, height) with a specified wl_output_transform.

Deprecated: this function is deprecated and will be removed in a future version of wlroots.

wlr_matrix_rotate()

void wlr_matrix_rotate(​float mat[], float rad);

Writes a 2D rotation matrix to mat at an angle of rad radians

wlr_matrix_scale()

void wlr_matrix_scale(​float mat[], float x, float y);

Writes a 2D scale matrix to mat of magnitude (x, y)

wlr_matrix_transform()

void wlr_matrix_transform(​float mat[], enum wl_output_transform transform);

Writes a transformation matrix which applies the specified wl_output_transform to mat

wlr_matrix_translate()

void wlr_matrix_translate(​float mat[], float x, float y);

Writes a 2D translation matrix to mat of magnitude (x, y)

wlr_matrix_transpose()

void wlr_matrix_transpose(​float mat[], const float a[]);