Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Cross-platform GUI Frameworks for 3D Apps and Games: Qt vs wxWidgets"— Presentation transcript:

1 Cross-platform GUI Frameworks for 3D Apps and Games: Qt vs wxWidgets
April 1, 2011 Nima Nikfetrat AmirSam Khataie

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: “Qt Designer” “DialogBlocks” We present candidate frameworks and tools Present our 3D sample applications Ranking for each section

3 Introduction Binary Tools + Source codes (Game Engines):
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

5 Introduction of wxWidgets
wxWidgets was started in by Julian Smart at the University of Edinburgh Initially for Unix and Windows 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)

6 Hello world, wxWidgets For each compiler and platform:
Libraries must be compiled (very fast, less than 5 minutes) Configuring compilers are a bit complex and different class MyApp : public wxApp { public: virtual bool OnInit(); }; // class MyFrame : public wxFrame MyFrame (const wxString& title); void OnQuit (wxCommandEvent& event); void OnAbout (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)

7 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

8 (A GUI Generator for wxWidgets)
DialogBlocks (A GUI Generator for wxWidgets)

9 DialogBlocks DialogBlocks is NOT a drag-and-drop tool !!
Price: $90 (student $47) DialogBlocks is NOT a drag-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

10 No Drag&Drop Any platforms

11 C++ Source Codes inside the dialog class

12 .xrc format (XML)

13 Generated Event for a button

14 OpenGL in Qt (3D Rendering)
wxGLCanvas class, 3D view can be displayed on: widgets wxPanel wxFrame To display: Split the window: wxBoxSizer Flags: wxHORIZONTAL, wxVERTICAL

15

16 Introduction of Qt Nokia acquired Trolltech for $153 million, 2008
Not the end of freedom for Qt: GPL license  LGPL (Qt 4.5, March 2009)

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

18 Signals and Slots, Qt // ** Auto-Connect ** private slots: void on_pushButton_clicked(); // void on_<object name>_<signal name>(); void myApp::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

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

20 Qt Designer (GUI Generator for Qt)

21 Qt Designer

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

23 Qt Designer Extended properties
Visual text paragraph, font , color editor (html format)

24 Qt Designer Style sheet: Customizing appearance of widgets ToolTip
WhatsThis Morph to other widgets

25 Qt Designer’s .ui file (XML) to C++
The qmake tool: detects .ui file generates the makefile rules The uic tool: converts .ui file into C++ puts the result in ui_name.h

26 Qt Widgets **Custom Widgets are visible in QtDesigner**

27 OpenGL in Qt (3D Rendering)
QGLWidget class: Enable OpenGL graphics to be rendered within a UI. 3D scenes can be displayed on widgets (can be placed in layouts) QGLShader class: Compiling OpenGL shaders Displaying: QGLWidget subclass as a QtDesigner plugin Manually inside the source codes

28 Comparison and Evaluation

29 Property Editor Required for any Game editors Available for wxWidgets:
Available for Qt : QtPropertyBrowser framework (by source codes from Nokia) Available for wxWidgets: wxPropertyGrid (Active SourceForge project) (Now Part of wxWidgets)

30 Summary of Evaluation 1 5 3 4 Rank: Poor (1) to excellent (5)
Qt 4.7 wxWidgets 2.9.1 Priority of Criteria Rank (Qt) Rank (wxWidgets) Standard widgets Fully satisfied 1 5 Advanced widgets Yes Very customizable 3 4 Custom Widgets Yes Plugins, Visual Property Editor External Source Code Built-In Rank: Poor (1) to excellent (5) Criteria: Low impact (1) to High impact (4)

31 Summary of Evaluation Advanced 2D/3D hardware accelerated features: Qt 4.7 wxWidgets 2.9.1 Priority of Criteria Rank (Qt) Rank (wxWidgets) Basic 3D support Yes 4 5 Advanced 3D support Compiling Shaders No 1 3 2D hardware rendering 2

32 Portability and Compatibility Compilers Integration
Summary of Evaluation Qt 4.7 wxWidgets 2.9.1 Priority of Criteria Rank (Qt) Rank (wxWidgets) Portability and Compatibility Yes 4 5 Compilers Integration VC++, Eclipse No Only libs and making project files GUI designer Third-party Documents Excellent Official book Samples Forum Forum / wxWiki 3

33 Maintainability development
Summary of Evaluation Qt 4.7 wxWidgets 2.9.1 Priority of Criteria Rank (Qt) Rank (wxWidgets) Maintainability development stability Excellent Good 3 5 4 Ease of use Less codes Less complex More codes A bit complex 1 Support (Commercial) Yes Customer Portal 2,000$ - 5,000$/yr Yes (Third-party) TT-solutions /phone/Skype 100€/hour 2 License Pricing (12 months) LGPL GPL Commercial 2,300$ – 3,700$ LGPL and User's own terms (binary)

34 Summary of Evaluation 3 5 1 4 Additional framework features: Qt 4.7
wxWidgets 2.9.1 Priority of Criteria Rank (Qt) Rank (wxWidgets) XML Yes 3 5 Multimedia 1 4 Multithreading Standard C++ New keywords added e.g. Public slot: Uses Macros a lot e.g. for main()

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

36 Major Users and Applications
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 Qt : 3D games / apps: Autodesk Maya 2011 Autodesk Mudbox3D Nextlimit RealFlow Google Earth Other apps: VLC player Skype

37 Thank you


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

Similar presentations


Ads by Google