]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderer.h
Eliminate the separate matrix stack in Renderer
[libs/gl.git] / source / renderer.h
index b114f6873648574032e8566bc3897d9e581fa348..157282a5398f6a18a23f0f80684a9765a16e7a3e 100644 (file)
@@ -64,6 +64,7 @@ public:
 private:
        struct State
        {
+               Matrix modelview_matrix;
                const Texture *texture;
                const Texturing *texturing;
                unsigned lowest_effect_texunit;
@@ -81,17 +82,6 @@ private:
                State();
        };
 
-       class MtxStack: public MatrixStack
-       {
-       private:
-               Renderer &renderer;
-
-       public:
-               MtxStack(Renderer &);
-       private:
-               virtual void update();
-       };
-
        enum ChangeMask
        {
                LEGACY_MATRIX = 1,
@@ -104,7 +94,6 @@ private:
                STANDARD_SHDATA = 64
        };
 
-       MtxStack mtx_stack;
        unsigned char changed;
        bool matrices_loaded;
        unsigned shdata_applied;
@@ -124,9 +113,6 @@ public:
        times without an intervening end(). */
        void begin(const Camera *);
 
-       /** Deprecated as unsafe.  Use set_matrix() or transform() instead. */
-       MatrixStack &matrix_stack() { return mtx_stack; }
-
        /** Replaces the Renderer's modelview matrix. */
        void set_matrix(const Matrix &);
 
@@ -134,7 +120,7 @@ public:
        void transform(const Matrix &);
 
        /** Returns the current modelview matrix. */
-       const Matrix &get_matrix() const { return mtx_stack.top(); }
+       const Matrix &get_matrix() const { return state->modelview_matrix; }
 
        const Camera *get_camera() const { return camera; }