Reimplement drawing system with vertex buffers.

Now with 10000% more performance.
This commit is contained in:
2017-11-23 14:43:31 +01:00
parent a62075f57d
commit f289b2f52b
9 changed files with 232 additions and 103 deletions

View File

@@ -103,8 +103,11 @@ GLuint fmri::compileShader(GLenum type, char const *source)
}
}
void ::fmri::setColorFromIntensity(float i)
void fmri::renderText(std::string_view text)
{
// TODO: something more expressive.
glColor3f(i, i, i);
constexpr auto font = GLUT_BITMAP_HELVETICA_10;
glRasterPos2i(0, 0);
for (char c : text) {
glutBitmapCharacter(font, c);
}
}