From 3905924fc35f92e5092576c3f6e8fc5db7588cde Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 17 Nov 2018 10:12:12 +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 | 47 +++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 17 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 1dddab3..fba62a1 100644 --- a/src/libjin/Graphics/je_gl.h +++ b/src/libjin/Graphics/je_gl.h @@ -14,21 +14,12 @@ namespace JinEngine namespace Graphics { - class OpenGL : public ogl2d::OpenGL + class OpenGL + : public ogl2d::OpenGL { public: /// /// - /// - Math::Matrix ProjectionMatrix; - - /// - /// - /// - Math::Matrix ModelMatrix; - - /// - /// /// OpenGL(); @@ -42,26 +33,48 @@ namespace JinEngine void push(); - void pop(); - void translate(float x, float y); void scale(float sx, float sy); void rotate(float r); - const Math::Matrix& getMatrix() { return mMatrix; }; + 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(); + + /// + /// 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 calcMatrix(); + 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