int main( int argc, char* argv[] )
{
   // Initialize the application
   // initialize the state of your app here if needed...
   OnApplicationInit();
   
   // Set the window's initial size
   ::glutInitWindowSize( 640, 480 );
   ::glutInit( &argc, argv );
  
   // Set to double buffer to reduce flicker
   ::glutInitDisplayMode( GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE );
    


   // Set the window title
   app.mainWin_contextID = ::glutCreateWindow( "Simple Load Runner" );
   
   std::cout<<"\n"<<std::flush;
   std::cout<<"set - by the Iowa State Game Developers" << std::endl << "by Josh Brown (contribution: 100%)" 
	<< std::endl << "*****@*****.**"<< std::endl<<std::flush;
   std::cout<<"\n"<<std::flush;
   
   // display callbacks.
   ::glutReshapeFunc( OnReshape );
   ::glutIdleFunc( OnIdle );
   ::glutDisplayFunc( OnRedisplay );

   // tell glut to not call the keyboard callback repeatedly 
   // when holding down a key. (uses edge triggering, like the mouse)
   //  ::glutIgnoreKeyRepeat( 1 );

   // keyboard callback functions.
   ::glutKeyboardFunc( OnKeyboardDown );
   ::glutKeyboardUpFunc( OnKeyboardUp );
   ::glutSpecialFunc( OnSpecialKeyboardDown );
   ::glutSpecialUpFunc( OnSpecialKeyboardUp );

   // mouse callback functions...
   ::glutMouseFunc( OnMouseClick );
   ::glutMotionFunc( OnMousePos );
   ::glutPassiveMotionFunc( OnMousePos );

   app.dek.init();
   
   // start the application loop, your callbacks will now be called
   // time for glut to sit and spin.
   ::glutMainLoop();
}
Exemple #2
0
int main(int argc, char* argv[])
{
    // Initialize the application
    // initialize the state of your app here if needed...
    OnApplicationInit();
   
    // Set the window's initial size
    ::glutInitWindowSize( 640, 480 );
    ::glutInit( &argc, argv );
  
    // Set to double buffer to reduce flicker
    ::glutInitDisplayMode( GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE );
    
    // Set the window title
    AppWindow::mainWin_contextID = ::glutCreateWindow( "GLUT application" );
    
    cout<<"\n"<<flush;
    cout<<"sonix sample OpenGL+sound app - by kevin - [email protected]\n"<<flush;
    cout<<"       usage:  t - trigger single shot sound\n"<<flush;
    cout<<"               y - trigger infinitly looping sound\n"<<flush;
    cout<<"               p - pause/unpause sound\n"<<flush;
    cout<<"               s - stop sound\n"<<flush;
    cout<<"               r - toggle isRetriggerable\n"<<flush;
    cout<<"               - - volume decrement\n"<<flush;
    cout<<"               = - volume increment\n"<<flush;
    cout<<"               [ - pitch decrement\n"<<flush;
    cout<<"               ] - pitch increment\n"<<flush;
    cout<<"               ; - lowpass filter cutoff decrement\n"<<flush;
    cout<<"               ' - lowpass filter cutoff increment\n"<<flush;
    cout<<"               , - move 3d sound source to the left\n"<<flush;
    cout<<"               . - move 3d sound source to the right\n"<<flush;
    cout<<"               1 - Change subsystem to OpenAL\n"<<flush;
    cout<<"               2 - Change subsystem to AudioWorks\n"<<flush;
    cout<<"               3 - Change subsystem to Subsynth\n"<<flush;
    cout<<"               4 - Change subsystem to None\n"<<flush;
    cout<<"               a - configure sound object to sol.wav\n"<<flush;
    cout<<"               b - configure sound object to drumsolo.wav\n"<<flush;
    cout<<"               c - configure sound object to suck.wav\n"<<flush;
    cout<<"               7 - trigger drum44100.wav\n"<<flush;
    cout<<"               8 - trigger attack.wav\n"<<flush;
    cout<<"               9 - trigger sol.wav\n"<<flush;
    cout<<"               0 - trigger sep.wav\n"<<flush;
    cout<<"\n"<<flush;
    
   // display callbacks.
   ::glutReshapeFunc( OnReshape );
   ::glutIdleFunc( OnIdle );
   ::glutDisplayFunc( OnRedisplay );

   // tell glut to not call the keyboard callback repeatedly 
   // when holding down a key. (uses edge triggering, like the mouse)
   ::glutIgnoreKeyRepeat( 1 );

   // keyboard callback functions.
   ::glutKeyboardFunc( OnKeyboardDown );
   ::glutKeyboardUpFunc( OnKeyboardUp );
   ::glutSpecialFunc( OnSpecialKeyboardDown );
   ::glutSpecialUpFunc( OnSpecialKeyboardUp );

   // mouse callback functions...
   ::glutMouseFunc( OnMouseClick );
   ::glutMotionFunc( OnMousePos );
   ::glutPassiveMotionFunc( OnMousePos );

    // start the application loop, your callbacks will now be called
    // time for glut to sit and spin.
    ::glutMainLoop();
    
    return 1;
}