Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Box2D Examples

 #include "felgoapplication.h"

 #include <QApplication>
 #include <QQmlApplicationEngine>

 int main(int argc, char *argv[])
 {

   QApplication app(argc, argv);

   FelgoApplication felgo;

   // QQmlApplicationEngine is the preferred way to start qml projects since Qt 5.2
   // if you have older projects using Qt App wizards from previous QtCreator versions than 3.1, please change them to QQmlApplicationEngine
   QQmlApplicationEngine engine;
   felgo.initialize(&engine);

   // either choose a single demo, or all of them
   // to display all of them with multiple GameWindow instances, call setGameWindowIsItem() - this is only needed for Felgo examples usually
   felgo.setMainQmlFileName(QStringLiteral("qml/Box2dMultiExamplesLoader.qml"));
   vplay.setGameWindowIsItem();

   // alternatively, call a single box2d example here
   //felgo.setMainQmlFileName(QStringLiteral("qml/Box2dExamplesMain.qml"));

   // use this instead of the above call to avoid deployment of the qml files and compile them into the binary with qt's resource system qrc
   // this is the preferred deployment option for debug and release builds on mobile, and for publish builds on all platforms
   // to avoid deployment of your qml files and images, also comment the DEPLOYMENTFOLDERS command in the .pro file
   // only use the above non-qrc approach, during development on desktop
   //  felgo.setMainQmlFileName(QStringLiteral("qrc:/qml/Box2dExamplesMain.qml"));

   engine.load(QUrl(felgo.mainQmlFileName()));
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded