+static void help()
+{
+ static const char *help_lines[] = {
+ "Camera control",
+ " LMB drag ....... rotate",
+ " MMB drag ....... pan",
+ " RMB drag/wheel . zoom",
+ " c .............. toggle free/animated camera",
+ " v .............. print current view parameters",
+ "",
+ "Animation control",
+ " <space> ........ pause time",
+ " <backspace> .... restart time",
+ " +/- ............ change beam rotation speed and set keyframe",
+ " 0 .............. clear beam rotation keyframes",
+ " [/] ............ change beam length and set keyframe",
+ " \\ .............. clear beam length keyframes",
+ " <enter> ........ record automatic beam start/stop transition",
+ " K .............. set camera keyframe",
+ " <shift>-L ...... clear all camera keyframes",
+ " X .............. toggle X logo and set keyframe",
+ " <shift>-X ...... clear logo keyframes",
+ " ~ .............. dump all animation keyframes to seq_dump",
+ 0
+ };
+
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_DEPTH_TEST);
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glOrtho(0, win_width, win_height, 0, -1, 1);
+
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glBegin(GL_QUADS);
+ glColor4f(0, 0, 0, 0.5);
+ glVertex2f(0, 0);
+ glVertex2f(0, win_height);
+ glVertex2f(win_width, win_height);
+ glVertex2f(win_width, 0);
+ glEnd();
+ glDisable(GL_BLEND);
+
+ int xpos = 20;
+ int ypos = 30;
+ for(int i=0; help_lines[i]; i++) {
+ glColor3f(0.05, 0.05, 0.05);
+ glRasterPos2i(xpos + 1, ypos + 2);
+ const char *s = help_lines[i];
+ while(*s) {
+ glutBitmapCharacter(GLUT_BITMAP_9_BY_15, *s++);
+ }
+ glColor3f(0.7, 1, 0.6);
+ glRasterPos2i(xpos, ypos);
+ s = help_lines[i];
+ while(*s) {
+ glutBitmapCharacter(GLUT_BITMAP_9_BY_15, *s++);
+ }
+
+ ypos += 25;
+ }