add newline feature to the text node, add about window with credits, add about menu with submenus

This commit is contained in:
2018-09-22 19:23:17 +02:00
parent fd8d6ff2d1
commit 3191730c31
18 changed files with 255 additions and 32 deletions

View File

@@ -105,6 +105,31 @@ std::vector<std::string> split(const std::string& subject, char d, int max_split
return ret;
}
std::string unescape(const std::string& s)
{
std::string res;
std::string::const_iterator it = s.begin();
while (it != s.end())
{
char c = *it++;
if (c == '\\' && it != s.end())
{
switch (*it++) {
case '\\': c = '\\'; break;
case 'n': c = '\n'; break;
case 't': c = '\t'; break;
// all other escapes
default:
// invalid escape sequence - skip it. alternatively you can copy it as is, throw an exception...
continue;
}
}
res += c;
}
return res;
}
static const char* gl2str(GLenum err)
{
switch (err)