diff options
Diffstat (limited to 'src/libjin/graphics/je_gl.h')
-rw-r--r-- | src/libjin/graphics/je_gl.h | 140 |
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 |