7 extern int win_width, win_height;
9 extern bool anim_stopped;
10 extern long anim_time;
24 glPushAttrib(GL_ENABLE_BIT);
25 glDisable(GL_DEPTH_TEST);
27 glMatrixMode(GL_MODELVIEW);
30 glMatrixMode(GL_PROJECTION);
33 glOrtho(0, win_width, win_height, 0, -1, 1);
36 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
52 glColor3f(1, 0.9, 0.5);
53 gl_printf(win_width - 100, 20, "%4ld.%03ld", anim_time / 1000, anim_time % 1000);
56 glMatrixMode(GL_MODELVIEW);
62 void gl_printf(int x, int y, const char *fmt, ...)
65 int buf_size, curx, cury;
69 buf_size = vsnprintf(&tmp, 0, fmt, ap);
76 buf = (char*)alloca(buf_size + 1);
78 vsnprintf(buf, buf_size + 1, fmt, ap);
81 static const float tabstop = 4;
82 static const float line_spacing = 18;
93 if(*buf == '\n') ++buf;
97 glRasterPos2i(curx, cury);
101 curx = (curx / tabstop) * tabstop + tabstop;
102 glRasterPos2i(curx, cury);
106 glutBitmapCharacter(GLUT_BITMAP_9_BY_15, c);