aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Font/Page.h
blob: e1430e148db5414dbf1fde5df115b8e1a7c393c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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