diff options
Diffstat (limited to 'src/libjin/Graphics/je_gl.h')
-rw-r--r-- | src/libjin/Graphics/je_gl.h | 47 |
1 files changed, 30 insertions, 17 deletions
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,22 +14,13 @@ namespace JinEngine namespace Graphics { - class OpenGL : public ogl2d::OpenGL + class OpenGL + : public ogl2d::OpenGL { public: /// /// /// - Math::Matrix ProjectionMatrix; - - /// - /// - /// - Math::Matrix ModelMatrix; - - /// - /// - /// OpenGL(); void setColor(Channel r, Channel g, Channel b, Channel a); @@ -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<Math::Matrix> mMatrices; - Math::Matrix mMatrix; + + std::vector<Math::Matrix> mModelViewMatrices; + Math::Matrix mModelViewMatrix; + + Math::Matrix mProjectionMatrix; }; + // Singleton. extern OpenGL gl; } // namespace Graphics |