static void timerCallback (int value) { tetris.MoveDown(); /* call back again after elapsedUSecs have passed */ glutTimerFunc (tetris.msecs, timerCallback, value); display(); }
void keyboard(unsigned char Key, int x, int y){ switch(Key){ case 'j': tetris.MoveDown(); break; case 'k': tetris.MoveRotate(); break; case 'h': tetris.MoveLeft(); break; case 'l': tetris.MoveRight(); break; default: break; }; display(); }