diff options
Diffstat (limited to 'src/libjin/Graphics')
-rw-r--r-- | src/libjin/Graphics/Font/je_font.h | 6 | ||||
-rw-r--r-- | src/libjin/Graphics/Font/je_texture_font.cpp | 10 | ||||
-rw-r--r-- | src/libjin/Graphics/Font/je_texture_font.h | 6 | ||||
-rw-r--r-- | src/libjin/Graphics/Font/je_ttf.cpp | 10 | ||||
-rw-r--r-- | src/libjin/Graphics/Font/je_ttf.h | 6 | ||||
-rw-r--r-- | src/libjin/Graphics/je_graphic.cpp | 4 | ||||
-rw-r--r-- | src/libjin/Graphics/je_graphic.h | 4 | ||||
-rw-r--r-- | src/libjin/Graphics/je_sprite.h | 4 |
8 files changed, 26 insertions, 24 deletions
diff --git a/src/libjin/Graphics/Font/je_font.h b/src/libjin/Graphics/Font/je_font.h index 2e9206b..42f83b6 100644 --- a/src/libjin/Graphics/Font/je_font.h +++ b/src/libjin/Graphics/Font/je_font.h @@ -63,7 +63,7 @@ namespace JinEngine /// @param x X value of the position. /// @param y Y value of the position. /// - virtual void print(const Page* page, int x, int y) = 0; + virtual void render(const Page* page, int x, int y) = 0; /// /// Render unicode codepoints to given position. @@ -74,7 +74,7 @@ namespace JinEngine /// @param lineheight Line height of the content. /// @param spacing Spacing between characters. /// - virtual void print(const Content& content, int x, int y, int lineheight, int spacing = 0) = 0; + virtual void render(const Content& content, int x, int y, int lineheight, int spacing = 0) = 0; /// /// Render text to given position. @@ -85,7 +85,7 @@ namespace JinEngine /// @param lineheight Line height of the text. /// @param spacing Spacing between characters. /// - virtual void print(const Text& text, int x, int y, int lineheight, int spacing = 0) = 0; + virtual void render(const Text& text, int x, int y, int lineheight, int spacing = 0) = 0; /// /// Get font size. diff --git a/src/libjin/Graphics/Font/je_texture_font.cpp b/src/libjin/Graphics/Font/je_texture_font.cpp index 9651c1a..30a927c 100644 --- a/src/libjin/Graphics/Font/je_texture_font.cpp +++ b/src/libjin/Graphics/Font/je_texture_font.cpp @@ -212,7 +212,7 @@ namespace JinEngine return typeset(*text, lineheight, spacing); } - void TextureFont::print(const Page* page, int x, int y) + void TextureFont::render(const Page* page, int x, int y) { Shader* shader = Shader::getCurrentShader(); const vector<GlyphArrayDrawInfo>& glyphinfolist = page->glyphinfolist; @@ -231,17 +231,17 @@ namespace JinEngine } } - void TextureFont::print(const Content& text, int x, int y, int lineheight, int spacing) + void TextureFont::render(const Content& text, int x, int y, int lineheight, int spacing) { Page* page = typeset(text, lineheight, spacing); - print(page, x, y); + render(page, x, y); delete page; } - void TextureFont::print(const Text& text, int x, int y, int lineheight, int spacing) + void TextureFont::render(const Text& text, int x, int y, int lineheight, int spacing) { Page* page = typeset(text, lineheight, spacing); - print(page, x, y); + render(page, x, y); delete page; } diff --git a/src/libjin/Graphics/Font/je_texture_font.h b/src/libjin/Graphics/Font/je_texture_font.h index 6276350..0cafff1 100644 --- a/src/libjin/Graphics/Font/je_texture_font.h +++ b/src/libjin/Graphics/Font/je_texture_font.h @@ -64,17 +64,17 @@ namespace JinEngine /// /// /// - void print(const Page* page, int x, int y) override; + void render(const Page* page, int x, int y) override; /// /// /// - void print(const Content& text, int x, int y, int linehgiht, int spacing = 0) override; + void render(const Content& text, int x, int y, int linehgiht, int spacing = 0) override; /// /// /// - void print(const Text& text, int x, int y, int lineheight, int spacing = 0)override; + void render(const Text& text, int x, int y, int lineheight, int spacing = 0)override; private: diff --git a/src/libjin/Graphics/Font/je_ttf.cpp b/src/libjin/Graphics/Font/je_ttf.cpp index a11efb0..72e5da9 100644 --- a/src/libjin/Graphics/Font/je_ttf.cpp +++ b/src/libjin/Graphics/Font/je_ttf.cpp @@ -224,10 +224,10 @@ namespace JinEngine return t; } - void TTF::print(const Content& t, int x, int y, int lineheight, int spacing) + void TTF::render(const Content& t, int x, int y, int lineheight, int spacing) { Page* page = typeset(t, lineheight, spacing); - print(page, x, y); + render(page, x, y); delete page; } @@ -299,7 +299,7 @@ namespace JinEngine return typeset(*text, lineheight, spacing); } - void TTF::print(const Page* page, int x, int y) + void TTF::render(const Page* page, int x, int y) { Shader* shader = Shader::getCurrentShader(); const vector<GlyphArrayDrawInfo>& glyphinfolist = page->glyphinfolist; @@ -318,9 +318,9 @@ namespace JinEngine } } - void TTF::print(const Text& text, int x, int y, int lineheight, int spacing /* = 0 */) + void TTF::render(const Text& text, int x, int y, int lineheight, int spacing /* = 0 */) { - print(*text, x, y, lineheight, spacing); + render(*text, x, y, lineheight, spacing); } int TTF::getCharWidth(int c) diff --git a/src/libjin/Graphics/Font/je_ttf.h b/src/libjin/Graphics/Font/je_ttf.h index e3d63b2..42e7e62 100644 --- a/src/libjin/Graphics/Font/je_ttf.h +++ b/src/libjin/Graphics/Font/je_ttf.h @@ -131,17 +131,17 @@ namespace JinEngine /// /// /// - void print(const Text& text, int x, int y, int lineheight, int spacing = 0) override; + void render(const Text& text, int x, int y, int lineheight, int spacing = 0) override; /// /// /// - void print(const Content& text, int x, int y, int lineheight, int spacing = 0) override; + void render(const Content& text, int x, int y, int lineheight, int spacing = 0) override; /// /// /// - void print(const Page* page, int x, int y) override; + void render(const Page* page, int x, int y) override; /// /// diff --git a/src/libjin/Graphics/je_graphic.cpp b/src/libjin/Graphics/je_graphic.cpp index 831e409..cce0c74 100644 --- a/src/libjin/Graphics/je_graphic.cpp +++ b/src/libjin/Graphics/je_graphic.cpp @@ -59,7 +59,7 @@ namespace JinEngine glDeleteTextures(1, &mTexture); } - void Graphic::draw(int x, int y, float sx, float sy, float r, float ox, float oy) + void Graphic::render(int x, int y, float sx, float sy, float r, float ox, float oy) { gl.ModelMatrix.setTransformation(x, y, r, sx, sy, ox, oy); @@ -74,7 +74,7 @@ namespace JinEngine gl.bindTexture(0); } - void Graphic::draw(const Math::Quad& slice, int x, int y, float sx, float sy, float r, float ax, float ay) + void Graphic::render(const Math::Quad& slice, int x, int y, float sx, float sy, float r, float ax, float ay) { float vertCoords[8] = { 0, 0, diff --git a/src/libjin/Graphics/je_graphic.h b/src/libjin/Graphics/je_graphic.h index 48684b8..5d5b2a5 100644 --- a/src/libjin/Graphics/je_graphic.h +++ b/src/libjin/Graphics/je_graphic.h @@ -44,12 +44,12 @@ namespace JinEngine /// /// /// - void draw(int x, int y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0); + void render(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); + void render(const Math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); /// /// diff --git a/src/libjin/Graphics/je_sprite.h b/src/libjin/Graphics/je_sprite.h index 3b96162..1d3c950 100644 --- a/src/libjin/Graphics/je_sprite.h +++ b/src/libjin/Graphics/je_sprite.h @@ -11,8 +11,9 @@ namespace JinEngine { namespace Graphics { + /// - /// A sprite is unit of rendering, logic and events. + /// A sprite is unit of rendering /// class Sprite { @@ -29,6 +30,7 @@ namespace JinEngine Math::Vector2<float> mScale; Color mColor; const Shader* mShader; + const Graphic* mGraphic; }; |