aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/graphics/je_gl.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-18 23:31:17 +0800
committerchai <chaifix@163.com>2018-11-18 23:31:17 +0800
commitf0f340dec7821cee103ab9267ef941a917ef4dc4 (patch)
tree2f77f6ce6bdc9f63f002c13d4c261e1d6a9c1729 /src/libjin/graphics/je_gl.h
parentfc7b4579e49aaeecc81919e247e03f68bd5abfd4 (diff)
*目录改为小写
Diffstat (limited to 'src/libjin/graphics/je_gl.h')
-rw-r--r--src/libjin/graphics/je_gl.h140
1 files changed, 140 insertions, 0 deletions
diff --git a/src/libjin/graphics/je_gl.h b/src/libjin/graphics/je_gl.h
new file mode 100644
index 0000000..134cfee
--- /dev/null
+++ b/src/libjin/graphics/je_gl.h
@@ -0,0 +1,140 @@
+#ifndef __JE_OPENGL_H__
+#define __JE_OPENGL_H__
+
+#include <vector>
+
+#include "../math/je_matrix.h"
+#include "../math/je_transform.h"
+
+#include "GLee/GLee.h"
+#include "ogl/OpenGL.h"
+
+#include "je_color.h"
+
+namespace JinEngine
+{
+ namespace Graphics
+ {
+
+ /*class Canvas;
+ class Shader;
+ class Font;
+*/
+ class OpenGL
+ : public ogl2d::OpenGL
+ {
+ public:
+ ///
+ ///
+ ///
+ OpenGL();
+
+ void setColor(Channel r, Channel g, Channel b, Channel a);
+
+ void setColor(Color c);
+
+ Color getColor();
+
+ void clearMatrix();
+
+ void push();
+
+ void translate(float x, float y);
+
+ void scale(float sx, float sy);
+
+ void rotate(float r);
+
+ void pop();
+
+ ///
+ ///
+ ///
+ Math::Matrix getModelViewMatrix(const Math::Transform& tansform);
+
+ ///
+ /// 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();
+
+ ///
+ ///
+ ///
+ void useShader();
+
+ ///
+ ///
+ ///
+ void useFont();
+
+ ///
+ ///
+ ///
+ void useCanvas();
+
+ ///
+ ///
+ ///
+ void unUseShader();
+
+ private:
+
+ ///
+ ///
+ ///
+ std::vector<Math::Matrix> mModelViewMatrices;
+
+ ///
+ ///
+ ///
+ Math::Matrix mModelViewMatrix;
+
+ ///
+ ///
+ ///
+ Math::Matrix mProjectionMatrix;
+
+ ///
+ ///
+ ///
+ Color mCurrentColor;
+/*
+ ///
+ ///
+ ///
+ Canvas* mCurrentCanvas;
+
+ ///
+ ///
+ ///
+ Shader* mCurrentShader;
+
+ ///
+ ///
+ ///
+ Font* mCurrentFont;
+*/
+ };
+
+ // Singleton.
+ extern OpenGL gl;
+
+ } // namespace Graphics
+} // namespace JinEngine
+
+#endif // __JE_OPENGL_H__ \ No newline at end of file