button, text is placed in middle of button, plane is placed behind text

This commit is contained in:
Remco
2016-06-20 12:38:16 +02:00
parent 6cf9437620
commit 8dcee70324
7 changed files with 53 additions and 26 deletions
+17
View File
@@ -3,6 +3,7 @@
Util::Util()
{
}
@@ -46,3 +47,19 @@ void Util::glutBitmapString(std::string str, int x, int y)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, str[i]);
}
}
int Util::glutTextWidth(const std::string str)
{
int total = 0;
for (int i = 0; i < str.size(); i++)
{
total += glutBitmapWidth(GLUT_BITMAP_HELVETICA_18, str[i]);
}
return total;
}
//int Util::glutTextHeight()
//{
// return glutBitmapHeight(GLUT_BITMAP_HELVETICA_18);
//}