X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmatrix.h;h=6aae6df0a0e5f2a494e570932f044cb64c89d8de;hb=dd32f2502f8d090c639df4a34d56d21ccbecac83;hp=42e70c985d5d78d0cc22d408e187f1dda7a5f025;hpb=705986ebcdd24573791aa58c7a8f2b7549c918a3;p=libs%2Fgl.git diff --git a/source/matrix.h b/source/matrix.h index 42e70c98..6aae6df0 100644 --- a/source/matrix.h +++ b/source/matrix.h @@ -1,14 +1,7 @@ -/* $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 +#include #include "gl.h" #include "vector.h" @@ -88,7 +81,7 @@ public: private: GLenum mode; - std::list matrices; + std::vector matrices; static GLenum current_mode; @@ -98,13 +91,13 @@ private: 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 &); @@ -114,38 +107,6 @@ public: 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