diff options
Diffstat (limited to 'src/libjin/Graphics/je_graphic.h')
-rw-r--r-- | src/libjin/Graphics/je_graphic.h | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/src/libjin/Graphics/je_graphic.h b/src/libjin/Graphics/je_graphic.h index fb6b19e..91c8b44 100644 --- a/src/libjin/Graphics/je_graphic.h +++ b/src/libjin/Graphics/je_graphic.h @@ -1,5 +1,5 @@ -#ifndef __JE_GRAPHIC_H -#define __JE_GRAPHIC_H +#ifndef __JE_GRAPHIC_H__ +#define __JE_GRAPHIC_H__ #include "../core/je_configuration.h" #if defined(jin_graphics) @@ -14,21 +14,14 @@ namespace JinEngine namespace Graphics { - // - // Graphic - // |-Texture - // |-Canvas - // - /// - /// Class inherites Graphic doesn't keep any state such as origin, scale and other - /// properties. + /// Class inherites Graphic doesn't keep any state such as origin, scale and other properties. /// class Graphic { public: /// - /// + /// /// Graphic(int w = 0, int h = 0); @@ -45,16 +38,6 @@ namespace JinEngine /// /// /// - void draw(int x, int y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0); - - /// - /// - /// - void draw(const Math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); - - /// - /// - /// inline int getWidth() const { return mSize.w; } /// @@ -63,24 +46,33 @@ namespace JinEngine inline int getHeight() const { return mSize.h; } /// - /// + /// Get opengl texture token. + /// + /// @return OpenGL texture token. /// - inline GLuint getTexture() const { return mTexture; } + inline GLuint getGLTexture() const { return mTexture; } /// /// /// void setFilter(GLint min, GLint max); + /// + /// Render graphic single with given coordinates. + /// + void render(int x, int y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0) const; + + /// + /// Render part of graphic single with given coordinates. + /// + void render(const Math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0) const; + protected: - GLuint mTexture; + Math::Vector2<uint> mSize; private: - JinEngine::Math::Vector2<uint> mSize; - // Screen coordinates and uv coordinates. - float mVertexCoords[8]; - float mTextureCoords[8]; - + GLuint mTexture; + }; } // namespace Graphics @@ -88,4 +80,4 @@ namespace JinEngine #endif // defined(jin_graphics) -#endif // __JE_GRAPHIC_H
\ No newline at end of file +#endif // __JE_GRAPHIC_H__
\ No newline at end of file |