-class MatrixStack
-{
-public:
- class Push
- {
- private:
- MatrixStack &stack;
-
- public:
- Push(MatrixStack &s): stack(s) { stack.push(); }
- ~Push() { stack.pop(); }
- };
-
-private:
- GLenum mode;
- std::vector<Matrix> matrices;
-
- static GLenum current_mode;
-
- MatrixStack(const MatrixStack &);
- MatrixStack &operator=(const MatrixStack &);
- MatrixStack(GLenum);
-public:
- MatrixStack();
-
- const Matrix &top() const;
- void load(const Matrix &);
- void multiply(const Matrix &);
- void push();
- void pop();
-private:
- virtual void update();
-
-public:
- MatrixStack &operator=(const Matrix &);
- MatrixStack &operator*=(const Matrix &);
-
- static MatrixStack &modelview();
- static MatrixStack &projection();
-};
-