Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Pong game;
    game.show();
    return a.exec();
}
Ejemplo n.º 2
0
/**************************************************************************//**
 * @author Daniel Andrus
 * 
 * @par Description: 
 * This function primarly passes control to the Pong class.
 * 
 * 
 * @param[in]      argc - Number of aurments from the command line
 * @param[out]     argv - An array of command line aurgments
 * 
 * @returns 0 program ran successfully.
 *****************************************************************************/
int main( int argc, char *argv[] )
{
	// Initialize program's core class
	Pong pong;

	// Run everything through the Pong class
	return pong.run( argc, argv);
}
Ejemplo n.º 3
0
int main(int argc, char** argv)
{
  QApplication app(argc, argv);

  Pong pong;
  pong.show();

  return app.exec();
}
Ejemplo n.º 4
0
int main(){

	Pong pong;



	pong.run();

}
Ejemplo n.º 5
0
int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

  Pong window;

  window.setWindowTitle("Super Pong");
  window.show();
  center(window);

  return app.exec();
}
Ejemplo n.º 6
0
/*********************************************
 * CALLBACK
 * The main interaction loop of the engine.
 * This gets called from OpenGL.  It give us our
 * interface pointer (where we get our events from)
 * as well as a void pointer which we know is our
 * game class.
 *********************************************/
void callBack(const Interface *pUI, void *p)
{
   // we know the void pointer is our game class so
   // cast it into the game class.
   Pong *pPong = (Pong *)p;

   // advance the ball
   pPong->advance();

   // check the paddle
   pPong->move(pUI->isUp(), pUI->isDown());

   // did we hit the ball?
   pPong->strike();

   // draw it
   pPong->draw();
}
Ejemplo n.º 7
0
int main()
#endif
{
   try
   {
      Pong game; // create a Pong object
      game.run(); // start the Pong game
   } // end try
   catch ( runtime_error &error )
   {
      #if OGRE_PLATFORM==PLATFORM_WIN32 || OGRE_PLATFORM==OGRE_PLATFORM_WIN32
      MessageBoxA( NULL, error.what(), "Exception Thrown!",
         MB_OK | MB_ICONERROR | MB_TASKMODAL );
      #else
      cerr << "Exception Thrown: " << error.what() << endl;
      #endif
   } // end catch
} // end main
Ejemplo n.º 8
0
int main(int argc, char **argv)
{
    QCoreApplication app(argc, argv);

    QObject obj;
    Pong *pong = new Pong(&obj);
    QObject::connect(&app, &QCoreApplication::aboutToQuit, pong, &Pong::aboutToQuit);
    pong->setProperty("value", "initial value");
    QDBusConnection::sessionBus().registerObject("/", &obj);

    if (!QDBusConnection::sessionBus().registerService(SERVICE_NAME)) {
        fprintf(stderr, "%s\n",
                qPrintable(QDBusConnection::sessionBus().lastError().message()));
        exit(1);
    }

    app.exec();
    return 0;
}
Ejemplo n.º 9
0
// OpenGL functions *******************************************************
void timerCallback(int value)
{
    g1.play();
    myDisplayCallback();
    glutTimerFunc(10, timerCallback, 0);
}
Ejemplo n.º 10
0
TEST(PongTest, Init)
{
  pong.Init(100, 10, 1, '.', 2, true);
  ASSERT_EQ(pong._pointsToWin, 1);
  ASSERT_EQ(10, pong._batSize);
}