1 / 37

Cross-platform GUI Frameworks for 3D Apps and Games: Qt vs wxWidgets

Cross-platform GUI Frameworks for 3D Apps and Games: Qt vs wxWidgets. April 1 , 2011 Nima Nikfetrat AmirSam Khataie. Introduction. Ultra Entertainment , a new game development company GUI frameworks to accelerate the production of: 3D tools / editors for game development .

nishan
Télécharger la présentation

Cross-platform GUI Frameworks for 3D Apps and Games: Qt vs wxWidgets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cross-platform GUI Frameworks for 3D Apps and Games:QtvswxWidgets April1, 2011 NimaNikfetrat AmirSamKhataie

  2. Introduction • Ultra Entertainment , a new game development company • GUI frameworks to accelerate the production of: • 3D tools / editors for game development. • C/C++ Cross-platform GUI frameworks • Qt • wxWidgets. • Third-party or built-In GUI generators: • “QtDesigner” • “DialogBlocks” • We present candidate frameworks and tools • Present our 3D sample applications • Ranking for each section

  3. Introduction • How the company uses or sells our 3D tools: • Binary Tools + Source codes (Game Engines): • To distribute/sell the binary format + source codes • A few customers ($1,000$ to $+50,000 per license / per game) • Binary format tools (Game / Apps): • Only binary format (bundled with the game) • Thousands of customers Rank: Poor (1) to excellent (5)Criterion: Low impact (1) to High impact (4)

  4. Introduction of wxWidgets • wxWidgetswas started in 1992 by Julian Smart at the University of Edinburgh • Initially for Unix andWindows • Later Mac platform, WinCE, etc. • Supported by volunteers (such as AOL) • GUI framework + more : • Network, • Clipboard , drag & drop, • Multithreading, • Image loading and saving, • Database, Platform Details: wxGTK (GTK+ 2.0) wxX11 (X11) wxMotif (X11 using Motif) wxOSX (Cocoa or Carbon API) wxMSW (Windows API)

  5. For each compiler and platform: • Libraries must be compiled (very fast, less than 5 minutes) • Configuring compilers are a bit complex and different Hello world, wxWidgets classMyApp : publicwxApp { public: virtualboolOnInit(); }; //------------------------------------------- classMyFrame : publicwxFrame { public: MyFrame (constwxString& title); voidOnQuit (wxCommandEvent& event); voidOnAbout (wxCommandEvent& event); private: DECLARE_EVENT_TABLE() }; // Using Macros BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU (Minimal_Quit, MyFrame::OnQuit) EVT_MENU (Minimal_About, MyFrame::OnAbout) END_EVENT_TABLE() IMPLEMENT_APP (MyApp)

  6. wxWidgets features • Widgets will be defined with IDs • (Similar to Win32 API) • Uses Macros for Event handling • (Similar to MFC) • Platform specific flags for methods/classes: • Always documentations must be checked • Lacks: • No integrated UI builder • No integration with compilers (Only manually as a library) • A third party GUI generator is really needed

  7. DialogBlocks (A GUI Generator for wxWidgets)

  8. DialogBlocks • Price: $90 (student $47) • DialogBlocksis NOTadrag-and-drop tool !! • More efficient portable dialogs with sizers • Can create “gcc” / “VC++” project files • Using outputs of DialogBlocks: • generated C++ .h and .cpp file • A separate XRC resource file (for each dialog) • A global XRC resource file (contains all dialog resources) • copy and paste the C++ or XRC code into your own project

  9. No Drag&Drop Any platforms

  10. C++ Source Codes inside the dialog class

  11. .xrc format(XML)

  12. Generated Event for a button

  13. OpenGL in Qt (3D Rendering) • wxGLCanvasclass, 3D view can be displayed on: • widgets • wxPanel • wxFrame • To display: • Split the window: wxBoxSizer • Flags: wxHORIZONTAL,wxVERTICAL

  14. Introduction of Qt • Nokia acquired Trolltechfor $153 million, 2008 • Not the end of freedom for Qt: • GPL license LGPL (Qt4.5, March 2009)

  15. Hello world, Qt #include “myApp.h" #include <QtGui/QApplication> intmain(intargc, char*argv[]) { QApplication app(argc, argv); myApp win; win.show(); returnapp.exec(); } • setupUi: Automatic UI generation • .uifile: An XML-based file format buttonBox= newQDialogButtonBox(test1Class); buttonBox->setObjectName(QString::fromUtf8("buttonBox")); buttonBox->setGeometry(QRect (80, 320, 156, 23)); buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);

  16. Signals and Slots, Qt // ** Auto-Connect ** private slots: voidon_pushButton_clicked(); // void on_<object name>_<signal name>(); voidmyApp::on_pushButton_clicked() { QMessageBox::information(this, tr("Text"), lineEdit1->text(), QMessageBox::Cancel); } // ** Without Auto-Connect ** connect (pushButton, SIGNAL (clicked()), this, SLOT (showTextMSg())); // Notice Macros and new keywords

  17. Qt Visual Studio integration • No complex setup • No libs configuration • Exclusive Qt Menu and wizard available • Dynamic or static libs

  18. Qt Designer (GUI Generator for Qt)

  19. Qt Designer

  20. Qt Designer • Edit Signal / Slots • First Implement methods in .cpp • Connect signals to slots • Example: clicked()  showText()

  21. Qt Designer • Extended properties • Visual text paragraph, font , color editor (html format)

  22. Qt Designer • Style sheet: • Customizing appearance of widgets • ToolTip • WhatsThis • Morph to other widgets

  23. QtDesigner’s .ui file (XML) to C++ • The qmaketool: • detects .ui file • generates the makefilerules • The uictool: • converts .ui file into C++ • puts the result in ui_name.h

  24. QtWidgets **Custom Widgets are visible in QtDesigner**

  25. OpenGL in Qt (3D Rendering) • QGLWidgetclass: • Enable OpenGL graphics to be rendered within a UI. • 3D scenes can be displayed on widgets (can be placed in layouts) • QGLShaderclass: • Compiling OpenGL shaders • Displaying: • QGLWidget subclass as a QtDesignerplugin • Manually inside the source codes

  26. Comparison and Evaluation

  27. Property Editor • Required for any Game editors • Available for Qt : • QtPropertyBrowser framework(bysource codes from Nokia) • Available for wxWidgets: • wxPropertyGrid (Active SourceForge project) (Now Part of wxWidgets)

  28. Summary of Evaluation Rank: Poor (1) to excellent (5) Criteria: Low impact (1) to High impact (4)

  29. Summary of Evaluation • Advanced 2D/3D hardware accelerated features:

  30. Summary of Evaluation

  31. Summary of Evaluation

  32. Summary of Evaluation • Additional framework features:

  33. Total Scores (out of 5) • Qt: 4.74 • wxWidgets: 4.18 • We recommend using Qt to facilitate the development of 3D game tools.

  34. Major Users and Applications • Qt: • 3D games / apps: • Autodesk Maya 2011 • Autodesk Mudbox3D • NextlimitRealFlow • Google Earth • Other apps: • VLC player • Skype • wxWidgets : • 3D games / apps: • Unreal Game Engine 3 • (Price: +1 million USD) • Shark 3D for games • Other apps: • Code::Blocks • FileZilla • AOL Communicator • AMD, Advanced Micro Devices

  35. Thank you

More Related