implement word wrap in text node

This commit is contained in:
2019-09-13 21:36:14 +02:00
parent 53787409cb
commit bbd9dfc4a9
4 changed files with 92 additions and 43 deletions

View File

@@ -44,6 +44,13 @@ public:
class TextMesh
{
struct Token
{
std::string s;
float w;
Token(const std::string& str, float width) : s(str), w(width) {}
};
std::vector<Token> tokenize(const std::string& s, const Font& f) const noexcept;
public:
GLuint font_array = 0;
int font_array_count = 0;