From a4db0e0622a3764d090a8c2ecf8bd5b56442ccef Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 16 Nov 2018 21:29:52 +0800 Subject: =?UTF-8?q?*=E6=9B=B4=E6=96=B0=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/je_gl.h | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'src/libjin/Graphics/je_gl.h') diff --git a/src/libjin/Graphics/je_gl.h b/src/libjin/Graphics/je_gl.h index 03bd26a..fba62a1 100644 --- a/src/libjin/Graphics/je_gl.h +++ b/src/libjin/Graphics/je_gl.h @@ -20,16 +20,6 @@ namespace JinEngine public: /// /// - /// - Math::Matrix ProjectionMatrix; -/* - /// - /// - /// - Math::Matrix ModelMatrix; -*/ - /// - /// /// OpenGL(); @@ -43,28 +33,48 @@ namespace JinEngine void push(); - void pop(); - void translate(float x, float y); void scale(float sx, float sy); void rotate(float r); - Math::Matrix getModelMatrix(float x, float y, float sx, float sy, float r, float ox, float oy); + void pop(); + + /// + /// Get model view matrix. + /// + Math::Matrix getModelViewMatrix(float x, float y, float sx, float sy, float r, float ox, float oy); + + /// + /// Get model view matrix. + /// + Math::Matrix getModelViewMatrix(); - Math::Matrix getModelMatrix(); + /// + /// Set orthogonal matrix. + /// + void setProjectionMatrix(float l, float r, float b, float t, float n, float f); + + /// + /// Get orthogonal matrix. + /// + const Math::Matrix& getProjectionMatrix(); private: void solve(); Color mCurrentColor; - std::vector mMatrices; - Math::Matrix mMatrix; + + std::vector mModelViewMatrices; + Math::Matrix mModelViewMatrix; + + Math::Matrix mProjectionMatrix; }; + // Singleton. extern OpenGL gl; } // namespace Graphics -- cgit v1.1-26-g67d0