added text widget parsing and rendering

This commit is contained in:
2017-02-06 23:32:01 +00:00
parent fd7f62693e
commit 3cc25e7592
7 changed files with 130 additions and 32 deletions

View File

@@ -4,7 +4,7 @@
enum class kFont : uint16_t
{
Arial_11 = const_hash("arial-16"),
Arial_11 = const_hash("arial-11"),
};
class Font
@@ -23,8 +23,10 @@ public:
class FontManager
{
static std::map<kFont, Font> m_fonts;
public:
static std::map<kFont, Font> m_fonts;
static Sampler m_sampler;
static void init();
static bool load(kFont id, const char* ttf);
static const Font& get(kFont id);
};
@@ -35,6 +37,9 @@ public:
GLuint font_array = 0;
int font_array_count = 0;
GLuint font_buffers[2] = {0, 0};
kFont font_id;
glm::vec2 bb;
bool create();
void update(kFont id, const char* text);
void draw();
};