int main(int argc, char *argv[]) { srand((unsigned int)time(0)); unsigned int width = 1280; unsigned int height = 720; size_t particles = (width * height) / PARTICLE_DENSITY; Fireworks fireworks(width, height, false); fireworks.SetParticleLimit(30); if (fireworks.Load()) { fireworks.Run(); return EXIT_SUCCESS; } sf::Sleep(1.0f); return EXIT_FAILURE; }
void Letter::showLetter() { letterEdit = new QTextEdit(this); letterEdit->setReadOnly(true); letterEdit->setAlignment(Qt::AlignHCenter); letterEdit->setFontPointSize(12); QPalette bgPalette; QPixmap bgPixmap(":/data/letter.png"); bgPalette.setBrush(QPalette::Base, QBrush(bgPixmap)); letterEdit->setPalette(bgPalette); letterTimer = new QTimer(this); connect(letterTimer, SIGNAL(timeout()), this, SLOT(appendLetter())); this->layout()->addWidget(letterEdit); letterTimer->start(200); keySequence.clear(); connect(this, SIGNAL(keyMatched(QByteArray)), this, SLOT(fireworks())); }
int main (int argc, char **argv) { cube_init(); pthread_t cube_thread; int iret, i, x; iret = pthread_create (&cube_thread, NULL, cube_updater, rs232_cube); while (1) { printf("Effect: sidewaves\n"); sidewaves(2000,100); printf("Effect: ripples\n"); ripples(2000,100); printf("Effect: linespin\n"); linespin(2000,100); printf("Effect: sinelines\n"); sinelines(2000,100); printf("Effect: spheremove\n"); spheremove(1500,100); printf("Effect: fireworks\n"); fireworks(7,50,1200); printf("Effect: gol_play\n"); for (i=0; i<10; i++) { for (x=0; x<20; x++) setvoxel(rand()%4,rand()%4,rand()%4); gol_play(50,1000); } } }