Cogl.MatrixStack.new
function new(ctx: Cogl.Context): Cogl.MatrixStack { // Gjs wrapper for cogl_matrix_stack_new() }
Allocates a new Cogl.MatrixStack that can be used to build up transformations relating to objects in a scenegraph like hierarchy. (See the description of Cogl.MatrixStack and Cogl.MatrixEntry for more details of what a matrix stack is best suited for)
When a Cogl.MatrixStack is first allocated it is conceptually positioned at the root of your scenegraph hierarchy. As you traverse your scenegraph then you should call Cogl.MatrixStack.prototype.push whenever you move down a level and Cogl.MatrixStack.prototype.pop whenever you move back up a level towards the root.
Once you have allocated a Cogl.MatrixStack you can get a reference to the current transformation for the current position in the hierarchy by calling Cogl.MatrixStack.prototype.get_entry.
Once you have allocated a Cogl.MatrixStack you can apply operations such as rotate, scale and translate to modify the current transform for the current position in the hierarchy by calling Cogl.MatrixStack.prototype.rotate, Cogl.MatrixStack.prototype.scale and Cogl.MatrixStack.prototype.translate.
- ctx
- Returns
A newly allocated Cogl.MatrixStack