//hitKeyM // Drawing a circle at the position of the pointer when key 'A' is hit. // T. Kosaka CS TNCT 2001 #include #include #include #include "drawShape2D.h" #ifndef M_PI #define M_PI 3.141592653589793 #endif void userdraw(void); void display(void) { glClear( GL_COLOR_BUFFER_BIT); userdraw(); glutSwapBuffers(); } unsigned int GlobalTick[40]={ 1000,1000,1000,1000,1000, 1000,1000,1000,1000,1000, 1000,1000,1000,1000,1000, 1000,1000,1000,1000,1000, 1000,1000,1000,1000,1000, 1000,1000,1000,1000,1000, 1000,1000,1000,1000,1000, 1000,1000,1000,1000,1000 }; point2D_t CurrentPoint[40]; void onKeyboard(unsigned char key, int x, int y_inv) { int y=480-y_inv-1; // device coordinate -> view coordinate int k; switch (key) { case 'A': case 'a': for (k=0;k<40;k++) { if (400