gl3n.ext.matrixstack

  • Declaration

    struct MatrixStack(T) if (is_matrix!T);

    A matrix stack similiar to OpenGLs glPushMatrix/glPopMatrix

    • Declaration

      alias Matrix = T;

      Holds the internal matrix type

    • top

      Declaration

      Matrix top;

      The top matrix, the one you work with

    • Declaration

      size_t realloc_interval;

      If the stack is too small to hold more items,

      Discussion

      space for realloc_interval more elements will be allocated

    • Declaration

      pure nothrow this(size_t depth);

      Sets the stacks initial size to depth elements

    • set

      Declaration

      pure nothrow void set(Matrix matrix);

      Sets the top matrix

    • Declaration

      pure nothrow void push();

      Pushes the top matrix on the stack and keeps a copy as the new top matrix

    • Declaration

      pure nothrow void push(Matrix matrix);

      Pushes the top matrix on the stack and sets matrix as the new top matrix.

    • pop

      Declaration

      pure nothrow ref Matrix pop();

      Pops a matrix from the stack and sets it as top matrix.

      Discussion

      Also returns a reference to the new top matrix.

  • Declaration

    pure nothrow MatrixStack!T matrixStack(T)(size_t depth = 16);

    Constructs a new stack with an initial size of depth elements