Matrix.value_ptr

Returns the pointer to the stored values as OpenGL requires it. Note this will return a pointer to a row-major matrix, this means you've to set the transpose argument to GL_TRUE when passing it to OpenGL.

struct Matrix(type, int rows_, int cols_)
@property const
value_ptr
()
if (
(rows_ > 0) &&
(cols_ > 0)
)

Examples

// 3rd argument = GL_TRUE
glUniformMatrix4fv(programs.main.model, 1, GL_TRUE, mat4.translation(-0.5f, -0.5f, 1.0f).value_ptr);

Meta