#include #include "vgl.h" #include "Lines.h" extern Lines starburst_G; using namespace std; void SpecialKeypress(int key, int x, int y) { return; } void KeyUp(unsigned char key, int x, int y) { return; } void SpecialUp(int key, int x, int y) { return; } bool DoAnimation = false; int delay = 1000/60; void Animate(int value) { starburst_G.TimeStep(); if(DoAnimation) { glutTimerFunc(delay, Animate,0); } glutPostRedisplay(); return; } void StartAnimation() { glutTimerFunc(delay, Animate,0); DoAnimation = true; return; } void StopAnimation() { DoAnimation = false;; return; } void KeyHelp() { cout << endl; cout << "Keys " << endl; cout << "\tq,Q\tQuit" << endl; cout << "\th,?\tHelp" << endl; cout << "\tr,R\tRedisplay" << endl; cout << endl; return; } void Keypress(unsigned char key, int x, int y) { static int state = 1; bool redisplay = false; switch (key) { case 'h': case '?': KeyHelp(); break; case 'Q': case 'q': exit(0); case 'r': case 'R': redisplay = true; break; default: cerr << "Unhandled keypress for key '" << key << "'" << endl; } if (redisplay) { glutPostRedisplay(); } return; }