Пример #1
0
// entry point of the program
int main( int arc, char* argv[] )
{	
	// First we need to create our Game Framework
	Initialise(SCREEN_X, SCREEN_Y, false,"Shoot em up" );

	initGame();
	initMenu();
	initBoss();
	initGameOver();
	gameProcess = &menuState;	
	do {
		frameCounter++;

		if(frameCounter > 5000)
			frameCounter = 0;
		
		gameProcess();	// function pointer to run game
		
	} while ( FrameworkUpdate() == false );
	// clean up memory
	destroyGame();
	destroyMenu();
	destroyBoss();
	destroyGameOver();
	
	Shutdown();

	return 0;
}
Пример #2
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    // Start game process in the browser
    QStringList params;
    params << GameUrl;
    QProcess gameProcess(&a);
    qDebug("Starting web browser");
    gameProcess.start(WebBrowser, params);

    // Read and play
    QThread::sleep(4);
    while (true)
    {
        QPixmap screen = QPixmap::grabWindow(QApplication::desktop()->winId());
        treatScreen(screen.toImage());
        QThread::msleep(100);
    }

    return a.exec();
}