Exemplo n.º 1
0
int main(int argc, char **argv)
{
    QGuiApplication app(argc, argv);

    QSurfaceFormat format;
    format.setSamples(16);

    TriangleWindow window;
    window.setFormat(format);
    window.resize(640, 480);
    window.show();

    window.setAnimating(true);

    return app.exec();
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
	printf("Create App\n");

#ifdef AA_DisableHighDpiScaling
	// XXX with high dpi scaling, plugin crashes without initial screen
	QCoreApplication::setAttribute(AA_DisableHighDpiScaling, true);
#endif

	QApplication app(argc, argv);

	if (app.platformName() != "barebone") {
		printf("This app requires QBareBone platform\n");
		return -1;
	}

	Card card;

	KmsManager* mgr = new KmsManager(card)

	QBareClient* bb = new QBareClient(app, mgr);

	//dump_screens(app);

	QList<QScreen*> screens = app.screens();
	QScreen* lcd = screens[0];
	QScreen* hdmi = screens[1];

	int test_num = 0;

	if (test_num == 0) {
		MainWindow *w1 = new MainWindow();
		//w1->winId();
		//w1->windowHandle()->setScreen(lcd);
		w1->move(50, 50);
		w1->show();

		//MainWindow *w2 = new MainWindow();
		//w2->winId();
		//w2->windowHandle()->setScreen(hdmi);
		//w2->move(300, 50);
		//w2->show();

	} else if (test_num == 1) {
		QSurfaceFormat format;
		format.setSamples(16);

		TriangleWindow *window = new TriangleWindow();
		window->setFormat(format);
		window->resize(640, 480);
		window->show();

		window->setAnimating(true);
	} else if (test_num == 2) {
		RasterWindow *w = new RasterWindow();
		w->show();
	} else if (test_num == 3) {
		QWidget* moveblk = create_moveblocks();
		moveblk->windowHandle()->setScreen(hdmi);
		moveblk->hide();
		moveblk->show();
	}

	printf("Enter mainloop\n");
	app.exec();

	delete bb;

	return 0;
}