aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/je_gl.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-17 10:12:12 +0800
committerchai <chaifix@163.com>2018-11-17 10:12:12 +0800
commit3905924fc35f92e5092576c3f6e8fc5db7588cde (patch)
treeffb50d6930f80f24a8c66e8e58cbd3c7d9d0261e /src/libjin/Graphics/je_gl.h
parente654344bc262c8393559e5cd535f440133fb2406 (diff)
*更新渲染
Diffstat (limited to 'src/libjin/Graphics/je_gl.h')
-rw-r--r--src/libjin/Graphics/je_gl.h47
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