-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#ifndef MSP_GL_MATRIX_H_
#define MSP_GL_MATRIX_H_
-#include <list>
+#include <vector>
#include "gl.h"
#include "vector.h"
private:
GLenum mode;
- std::list<Matrix> matrices;
+ std::vector<Matrix> matrices;
static GLenum current_mode;
public:
MatrixStack();
- const Matrix &top();
+ const Matrix &top() const;
void load(const Matrix &);
void multiply(const Matrix &);
void push();
void pop();
private:
- void update();
+ virtual void update();
public:
MatrixStack &operator=(const Matrix &);
static MatrixStack &projection();
};
-
-/* The stuff below is deprecated and preserved (for now) only for compatibility
-with existing applications */
-
-enum MatrixMode
-{
- MODELVIEW = GL_MODELVIEW,
- PROJECTION = GL_PROJECTION,
- TEXTURE = GL_TEXTURE
-};
-
-void matrix_mode(MatrixMode);
-void load_identity();
-void load_matrix(const float *);
-void load_matrix(const double *);
-void mult_matrix(const float *);
-void mult_matrix(const double *);
-void push_matrix();
-void pop_matrix();
-
-/// RAII object - pushes matrix when constructed and pops when destroyed
-struct PushMatrix
-{
- PushMatrix() { push_matrix(); }
- ~PushMatrix() { pop_matrix(); }
-};
-
-void translate(float, float, float);
-void rotate(float, float, float, float);
-void scale(float, float, float);
-void scale_uniform(float);
-
} // namespace GL
} // namespace Msp