tests/cuda4.1sdk/tests/nbody/nbody.cpp
void key(unsigned char key, int /*x*/, int /*y*/)
{
    switch (key) 
    {
    case ' ':
        bPause = !bPause;
        break;
    case 27: // escape
    case 'q':
    case 'Q':
        cutilDeviceReset();
        exit(0); 
        break;
    case 13: // return
        if (bSupportDouble)
        {
            if (fp64)
                switchDemoPrecision<float, double>();
            else
                switchDemoPrecision<double, float>();

			shrLog("> %s precision floating point simulation\n", fp64 ? "Double" : "Single");
        }

		break;
    case '`':
        bShowSliders = !bShowSliders;
        break;
	case 'g':
	case 'G':
		bDispInteractions = !bDispInteractions;
		break;
    case 'p':
    case 'P':
        displayMode = (ParticleRenderer::DisplayMode)
                      ((displayMode + 1) % ParticleRenderer::PARTICLE_NUM_MODES);
        break;
    case 'c':
    case 'C':
        cycleDemo = !cycleDemo;
        shrLog("Cycle Demo Parameters: %s\n", cycleDemo ? "ON" : "OFF");
        break;
    case '[':
        activeDemo = (activeDemo == 0) ? numDemos - 1 : (activeDemo - 1) % numDemos;
        selectDemo(activeDemo);
        break;
    case ']':
        activeDemo = (activeDemo + 1) % numDemos;
        selectDemo(activeDemo);
        break;
    case 'd':
    case 'D':
        displayEnabled = !displayEnabled;
        break;
    case 'o':
    case 'O':
        activeParams.print();
        break;
    case '1':
        if (fp64)
            NBodyDemo<double>::reset(numBodies, NBODY_CONFIG_SHELL);
        else
            NBodyDemo<float>::reset(numBodies, NBODY_CONFIG_SHELL);
        break;
    case '2':
        if (fp64)
            NBodyDemo<double>::reset(numBodies, NBODY_CONFIG_RANDOM);
        else
            NBodyDemo<float>::reset(numBodies, NBODY_CONFIG_RANDOM);
        break;
    case '3':
        if (fp64)
            NBodyDemo<double>::reset(numBodies, NBODY_CONFIG_EXPAND);
        else
            NBodyDemo<float>::reset(numBodies, NBODY_CONFIG_EXPAND);
        break;
    }

    glutPostRedisplay();
}
// commented out to remove unused parameter warnings in Linux
commented out to remove unused parameter warnings in Linux
commented out to remove unused parameter warnings in Linux
void key(unsigned char key, int , int )
{
    switch (key) 
    {
    case ' ':
        bPause = !bPause;
        break;
    case 27: 
    case 'q':
    case 'Q':
        cutilDeviceReset();
        exit(0); 
        break;
    case 13: 
        if (bSupportDouble)
        {
            if (fp64)
                switchDemoPrecision<float, double>();
            else
                switchDemoPrecision<double, float>();
			shrLog("> %s precision floating point simulation\n", fp64 ? "Double" : "Single");
        }
		break;
    case '`':
        bShowSliders = !bShowSliders;
        break;
	case 'g':
	case 'G':
		bDispInteractions = !bDispInteractions;
		break;
    case 'p':
    case 'P':
        displayMode = (ParticleRenderer::DisplayMode)
                      ((displayMode + 1) % ParticleRenderer::PARTICLE_NUM_MODES);
        break;
    case 'c':
    case 'C':
        cycleDemo = !cycleDemo;
        shrLog("Cycle Demo Parameters: %s\n", cycleDemo ? "ON" : "OFF");
        break;
    case '[':
        activeDemo = (activeDemo == 0) ? numDemos - 1 : (activeDemo - 1) % numDemos;
        selectDemo(activeDemo);
        break;
    case ']':
        activeDemo = (activeDemo + 1) % numDemos;
        selectDemo(activeDemo);
        break;
    case 'd':
    case 'D':
        displayEnabled = !displayEnabled;
        break;
    case 'o':
    case 'O':
        activeParams.print();
        break;
    case '1':
        if (fp64)
            NBodyDemo<double>::reset(numBodies, NBODY_CONFIG_SHELL);
        else
            NBodyDemo<float>::reset(numBodies, NBODY_CONFIG_SHELL);
        break;
    case '2':
        if (fp64)
            NBodyDemo<double>::reset(numBodies, NBODY_CONFIG_RANDOM);
        else
            NBodyDemo<float>::reset(numBodies, NBODY_CONFIG_RANDOM);
        break;
    case '3':
        if (fp64)
            NBodyDemo<double>::reset(numBodies, NBODY_CONFIG_EXPAND);
        else
            NBodyDemo<float>::reset(numBodies, NBODY_CONFIG_EXPAND);
        break;
    }
    glutPostRedisplay();
}
void key ( unsigned char key , int , int ) { switch ( key ) { case ' ' : bPause = ! bPause ; break ; case 27 : case ' ' : case ' ' : cutilDeviceReset ( ) ; exit ( 0 ) ; break ; case 13 : if ( bSupportDouble ) { if ( fp64 ) switchDemoPrecision < float , double > ( ) ; else switchDemoPrecision < double , float > ( ) ; shrLog ( " \n " , fp64 ? " " : " " ) ; } break ; case ' ' : bShowSliders = ! bShowSliders ; break ; case ' ' : case ' ' : bDispInteractions = ! bDispInteractions ; break ; case ' ' : case ' ' : displayMode = ( ParticleRenderer :: DisplayMode ) ( ( displayMode + 1 ) % ParticleRenderer :: PARTICLE_NUM_MODES ) ; break ; case ' ' : case ' ' : cycleDemo = ! cycleDemo ; shrLog ( " \n " , cycleDemo ? " " : " " ) ; break ; case ' ' : activeDemo = ( activeDemo == 0 ) ? numDemos - 1 : ( activeDemo - 1 ) % numDemos ; selectDemo ( activeDemo ) ; break ; case ' ' : activeDemo = ( activeDemo + 1 ) % numDemos ; selectDemo ( activeDemo ) ; break ; case ' ' : case ' ' : displayEnabled = ! displayEnabled ; break ; case ' ' : case ' ' : activeParams . print ( ) ; break ; case ' ' : if ( fp64 ) NBodyDemo < double > :: reset ( numBodies , NBODY_CONFIG_SHELL ) ; else NBodyDemo < float > :: reset ( numBodies , NBODY_CONFIG_SHELL ) ; break ; case ' ' : if ( fp64 ) NBodyDemo < double > :: reset ( numBodies , NBODY_CONFIG_RANDOM ) ; else NBodyDemo < float > :: reset ( numBodies , NBODY_CONFIG_RANDOM ) ; break ; case ' ' : if ( fp64 ) NBodyDemo < double > :: reset ( numBodies , NBODY_CONFIG_EXPAND ) ; else NBodyDemo < float > :: reset ( numBodies , NBODY_CONFIG_EXPAND ) ; break ; } glutPostRedisplay ( ) ; }
commented out to remove unused parameter warnings in Linux
commented out to remove unused parameter warnings in Linux
/*x*/ /*y*/ // escape // return