/*keybord function
@param[in] key, the type of the key
@param[in] x,y : the current position of the mouse
*/
void Keyboard(unsigned char key, int x, int y)
{
	int mod = glutGetModifiers();		//the state(Shift,Ctrl,Alt)

	switch(key){
	case '\033': // the ASCII code of ESC
		OnExitApp();
		break;

	case ' ':	//idle
		Idle();
		break;

	case 's':	//animation ON/OFF
		SwitchIdle(-1);
		break;

	case 'F':   //Fullscreen
		SwitchFullScreen();
		break;

	default:	//drawing flag
		{
			int idx = 0;
			while(RX_DRAW_STR[2*idx]!="-1"&&(int)RX_DRAW_STR[2*idx+1][0]!=key) idx++;
			if(RX_DRAW_STR[2*idx]!="-1"){
				g_iDraw=(0x01<<idx);
			}
		}
		break;
	}
	glutPostRedisplay();
}
Exemple #2
0
int CXtApp::ExitApplication(void)
{
	OnExitApp();

	return FUN_RET_OK;
}