diff options
Diffstat (limited to 'src/libjin/Graphics/je_gl.cpp')
-rw-r--r-- | src/libjin/Graphics/je_gl.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/libjin/Graphics/je_gl.cpp b/src/libjin/Graphics/je_gl.cpp index 3f19d36..a559c07 100644 --- a/src/libjin/Graphics/je_gl.cpp +++ b/src/libjin/Graphics/je_gl.cpp @@ -15,7 +15,7 @@ namespace JinEngine : ogl2d::OpenGL() { mMatrices.push_back(Matrix()); - calcMatrix(); + solve(); } void OpenGL::setColor(Channel r, Channel g, Channel b, Channel a) @@ -51,10 +51,10 @@ namespace JinEngine if (mMatrices.size() == 1) return; mMatrices.pop_back(); - calcMatrix(); + solve(); } - void OpenGL::calcMatrix() + void OpenGL::solve() { mMatrix.setIdentity(); for (Matrix& m : mMatrices) @@ -88,5 +88,17 @@ namespace JinEngine mMatrix.rotate(r); } + Matrix OpenGL::getModelMatrix(float x, float y, float sx, float sy, float r, float ox, float oy) + { + Matrix m; + m.setTransformation(x, y, sx, sy, r, ox, oy); + return mMatrix*m; + } + + Math::Matrix OpenGL::getModelMatrix() + { + return mMatrix; + } + } // namespace Graphics -} // namespace JinEngine +} // namespace JinEngine
\ No newline at end of file |