From 4279e16ddb6273a9711ff331d21325dd5f63e769 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 18 Nov 2018 23:45:58 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E7=9B=AE=E5=BD=95=E4=B8=BA=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/je_gl.cpp | 116 ------------------------------------------ 1 file changed, 116 deletions(-) delete mode 100644 src/libjin/Graphics/je_gl.cpp (limited to 'src/libjin/Graphics/je_gl.cpp') diff --git a/src/libjin/Graphics/je_gl.cpp b/src/libjin/Graphics/je_gl.cpp deleted file mode 100644 index c58f0ac..0000000 --- a/src/libjin/Graphics/je_gl.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#define OGL2D_IMPLEMENT -#include "je_gl.h" -#include "je_color.h" - -using namespace JinEngine::Math; - -namespace JinEngine -{ - namespace Graphics - { - - OpenGL gl; - - OpenGL::OpenGL() - : ogl2d::OpenGL() - { - mModelViewMatrices.push_back(Matrix()); - mModelViewMatrix.setIdentity(); - for (Matrix& m : mModelViewMatrices) - mModelViewMatrix *= m; - } - - void OpenGL::setColor(Channel r, Channel g, Channel b, Channel a) - { - setColor(Color(r, g, b, a)); - } - - void OpenGL::setColor(Color c) - { - mCurrentColor = c; - glColor4f(c.r / 255.f, c.g / 255.f, c.b / 255.f, c.a / 255.f); - } - - Color OpenGL::getColor() - { - return mCurrentColor; - } - - void OpenGL::clearMatrix() - { - mModelViewMatrices.clear(); - mModelViewMatrices.push_back(Matrix()); - mModelViewMatrix.setIdentity(); - } - - void OpenGL::push() - { - mModelViewMatrices.push_back(Matrix()); - } - - void OpenGL::pop() - { - if (mModelViewMatrices.size() == 1) - return; - mModelViewMatrices.pop_back(); - mModelViewMatrix.setIdentity(); - for (Matrix& m : mModelViewMatrices) - mModelViewMatrix *= m; - } - - void OpenGL::translate(float x, float y) - { - if (mModelViewMatrices.size() == 1) - return; - Matrix& m = mModelViewMatrices.back(); - m.translate(x, y); - mModelViewMatrix.translate(x, y); - } - - void OpenGL::scale(float sx, float sy) - { - if (mModelViewMatrices.size() == 1) - return; - Matrix& m = mModelViewMatrices.back(); - m.scale(sx, sy); - mModelViewMatrix.scale(sx, sy); - } - - void OpenGL::rotate(float r) - { - if (mModelViewMatrices.size() == 1) - return; - Matrix& m = mModelViewMatrices.back(); - m.rotate(r); - mModelViewMatrix.rotate(r); - } - - Matrix OpenGL::getModelViewMatrix(float x, float y, float sx, float sy, float r, float ox, float oy) - { - Matrix m; - m.setTransformation(x, y, r, sx, sy, ox, oy); - return mModelViewMatrix*m; - } - - Math::Matrix OpenGL::getModelViewMatrix(const Math::Transform& tansform) - { - return mModelViewMatrix * tansform.getMatrix(); - } - - Matrix OpenGL::getModelViewMatrix() - { - return mModelViewMatrix; - } - - const Matrix& OpenGL::getProjectionMatrix() - { - return mProjectionMatrix; - } - - void OpenGL::setProjectionMatrix(float l, float r, float b, float t, float n, float f) - { - mProjectionMatrix.setOrtho(l, r, b, t, n, f); - } - - } // namespace Graphics -} // namespace JinEngine \ No newline at end of file -- cgit v1.1-26-g67d0