A matrix stack similiar to OpenGLs glPushMatrix/glPopMatrix
Holds the internal matrix type
The top matrix, the one you work with
If the stack is too small to hold more items, space for realloc_interval more elements will be allocated
Sets the stacks initial size to depth elements
Sets the top matrix
Pushes the top matrix on the stack and keeps a copy as the new top matrix
Pushes the top matrix on the stack and sets matrix as the new top matrix.
Pops a matrix from the stack and sets it as top matrix. Also returns a reference to the new top matrix.