diff options
author | chai <chaifix@163.com> | 2018-10-14 22:52:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-14 22:52:40 +0800 |
commit | b1bbc998960fff2169dc5a992c47d08723472f9b (patch) | |
tree | 220f3bd5de2266e248884e11161dd715d7632ef2 /src/libjin/Graphics/Font/Page.h | |
parent | fbf989f9950a38566e0fb0fc5b6a7aebc9f0fb45 (diff) |
*直接渲染字符串
Diffstat (limited to 'src/libjin/Graphics/Font/Page.h')
-rw-r--r-- | src/libjin/Graphics/Font/Page.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/libjin/Graphics/Font/Page.h b/src/libjin/Graphics/Font/Page.h new file mode 100644 index 0000000..6e7cbdf --- /dev/null +++ b/src/libjin/Graphics/Font/Page.h @@ -0,0 +1,38 @@ +#ifndef __LIBJIN_PAGE_H +#define __LIBJIN_PAGE_H +#include "../../math/Vector2.hpp" +#include "Font.h" + +namespace jin +{ +namespace graphics +{ + + class Font; + + struct GlyphVertex + { + int x, y; // screen coordinates + float u, v; // texture uv + }; + + struct GlyphArrayDrawInfo + { + GLuint texture; // atlas + unsigned int start; // glyph vertex indecies + unsigned int count; // glyph vertex count + }; + + /* for reduce draw call */ + struct Page + { + Font* font; + std::vector<GlyphArrayDrawInfo> glyphinfolist; + std::vector<GlyphVertex> glyphvertices; + math::Vector2<int> size; + }; + +} +} + +#endif
\ No newline at end of file |