+void draw_text(float x, float y, float r, float g, float b, const char *fmt, ...)
+{
+ char buf[256], *text = buf;
+ va_list ap;
+
+ va_start(ap, fmt);
+ vsprintf(buf, fmt, ap);
+ va_end(ap);
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glOrtho(0, win_width, 0, win_height, -1, 1);
+
+ glDisable(GL_LIGHTING);
+
+ glRasterPos2f(1, 1);
+ glColor3f(r, g, b);
+ while(*text) {
+ glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *text++);
+ }
+
+ glEnable(GL_LIGHTING);
+
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+}
+