Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create a launcher to be used by all examples and remove old main.cpp …

…files

Signed-off-by: Roger Zanoni <roger.zanoni@openbossa.org>
  • Loading branch information...
commit a88ecf9c6b4d4ef842b0c5456d2d57bdbfcc26c5 1 parent d471aa6
@rogerzanoni rogerzanoni authored
Showing with 62 additions and 479 deletions.
  1. +4 −2 examples/animated_layer/animated_layer.pro
  2. +4 −2 examples/box2dpolygon_circle/box2dpolygon_circle.pro
  3. +0 −41 examples/box2dpolygon_circle/main.cpp
  4. +4 −2 examples/box2dscene/box2dscene.pro
  5. +0 −41 examples/box2dscene/main.cpp
  6. +4 −2 examples/gamescene/gamescene.pro
  7. +0 −41 examples/gamescene/main.cpp
  8. +0 −2  examples/gamewindow/GameWindow.qml
  9. +4 −2 examples/gamewindow/gamewindow.pro
  10. +0 −41 examples/gamewindow/main.cpp
  11. +14 −2 examples/{animated_layer → launcher}/main.cpp
  12. +0 −41 examples/manysprites/main.cpp
  13. +4 −2 examples/manysprites/manysprites.pro
  14. +0 −41 examples/movement/main.cpp
  15. +4 −2 examples/movement/movement.pro
  16. +0 −41 examples/parallax_layers/main.cpp
  17. +4 −2 examples/parallax_layers/parallax_layers.pro
  18. +0 −41 examples/simplecollision/main.cpp
  19. +4 −2 examples/simplecollision/simplecollision.pro
  20. +0 −41 examples/sprite/main.cpp
  21. +4 −2 examples/sprite/sprite.pro
  22. +0 −41 examples/static_layer/main.cpp
  23. +4 −2 examples/static_layer/static_layer.pro
  24. +0 −41 examples/updateInterval/main.cpp
  25. +4 −2 examples/updateInterval/updateInterval.pro
View
6 examples/animated_layer/animated_layer.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = animated_layer
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
6 examples/box2dpolygon_circle/box2dpolygon_circle.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = box2dpolygon_circle
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/box2dpolygon_circle/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/box2dscene/box2dscene.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = box2dscene
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/box2dscene/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/gamescene/gamescene.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = gamescene
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/gamescene/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
2  examples/gamewindow/GameWindow.qml
@@ -28,8 +28,6 @@ QuasiGame {
width: 400
height: 250
- onUpdate: console.log("update", delta)
-
Component.onCompleted: {
console.log("fps", game.fps)
}
View
6 examples/gamewindow/gamewindow.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = gamewindow
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/gamewindow/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
16 examples/animated_layer/main.cpp → examples/launcher/main.cpp
@@ -19,18 +19,30 @@
* @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
*/
+#include <QtCore/qglobal.h>
+
+#if QT_VERSION >= 0x050000
#include <QGuiApplication>
#include <QQuickView>
-#include <QDeclarativeEngine>
+#else
+#include <QtGui/QApplication>
+#include <QtDeclarative/QDeclarativeView>
+#endif
+
#include <QDir>
+#include <QDeclarativeEngine>
int main(int argc, char *argv[]) {
QByteArray data = "1";
qputenv("QML_IMPORT_TRACE", data);
+#if QT_VERSION >= 0x050000
QGuiApplication app(argc, argv);
-
QQuickView view;
+#else
+ QApplication app(argc, argv);
+ QDeclarativeView view;
+#endif
view.engine()->addImportPath("../../imports");
View
41 examples/manysprites/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/manysprites/manysprites.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = manysprites
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/movement/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/movement/movement.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = movement
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/parallax_layers/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/parallax_layers/parallax_layers.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = parallax_layers
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/simplecollision/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/simplecollision/simplecollision.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = simplecollision
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/sprite/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/sprite/sprite.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = sprite
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/static_layer/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/static_layer/static_layer.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = static_layer
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
View
41 examples/updateInterval/main.cpp
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2012 by INdT
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org>
- * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org>
- */
-
-#include <QGuiApplication>
-#include <QQuickView>
-#include <QDeclarativeEngine>
-#include <QDir>
-
-int main(int argc, char *argv[]) {
- QByteArray data = "1";
- qputenv("QML_IMPORT_TRACE", data);
-
- QGuiApplication app(argc, argv);
-
- QQuickView view;
-
- view.engine()->addImportPath("../../imports");
-
- view.setSource(QUrl::fromLocalFile("GameWindow.qml"));
- view.show();
-
- return app.exec();
-}
View
6 examples/updateInterval/updateInterval.pro
@@ -1,9 +1,11 @@
CONFIG += qt
-QT += quick
+
+contains(QT_VERSION, ^5.*) QT += quick
+else: QT += declarative
TEMPLATE = app
TARGET = updateInterval
DEPENDPATH += .
INCLUDEPATH += .
-SOURCES += main.cpp
+SOURCES += ../launcher/main.cpp
Please sign in to comment.
Something went wrong with that request. Please try again.