Docstoc

Transformation for Stereoscopic Visual Simulation

Document Sample
Transformation for Stereoscopic Visual Simulation Powered By Docstoc
					      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”


        1. We present candidate frameworks and tools
        2. Present our 3D sample applications
        3. 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
                                                                         5


Introduction of wxWidgets
 wxWidgets was started in 1992
 by Julian Smart at the University of Edinburgh

 Initially for Unix and Windows
    Later Mac platform, WinCE, etc.

 Supported by volunteers (such as AOL)

                                           Platform Details:
 GUI framework + more :
   Network,                               wxGTK (GTK+ 2.0)
   Clipboard , drag & drop,               wxX11 (X11)
   Multithreading,                        wxMotif (X11 using Motif)
   Image loading and saving,
                                           wxOSX (Cocoa or Carbon API)
   Database,
                                           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
{
public:
    MyFrame (const wxString& title);                // Using Macros
                                                    BEGIN_EVENT_TABLE(MyFrame, wxFrame)
   void OnQuit (wxCommandEvent& event);                 EVT_MENU (Minimal_Quit, MyFrame::OnQuit)
   void OnAbout (wxCommandEvent& event);                EVT_MENU (Minimal_About, MyFrame::OnAbout)
                                                    END_EVENT_TABLE()
private:
   DECLARE_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




       DialogBlocks

(A GUI Generator for wxWidgets)
                                                                  9


DialogBlocks
 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:
  1. generated C++ .h and .cpp file
  2. A separate XRC resource file (for each dialog)
  3. A global XRC resource file (contains all dialog resources)
  4. 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
 #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
 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:
  1. QGLWidget subclass
     as a QtDesigner plugin

  2. Manually inside
     the source codes
28
                                                   29


Property Editor
 Required for any Game editors




 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

                                                    Priority of   Rank      Rank
                 Qt 4.7        wxWidgets 2.9.1
                                                     Criteria     (Qt)   (wxWidgets)


Standard
widgets
             Fully satisfied      Fully satisfied       1          5         5


Advanced          Yes
 widgets
                                       Yes              3          5         4
           Very customizable


 Custom           Yes
 Widgets
                                       Yes              4          5         4
            Plugins, Visual

                  Yes
Property                               Yes
 Editor
               External                                 4          3         4
                                     Built-In
             Source Code

                          Rank:       Poor (1) to excellent (5)
                          Criteria: Low impact (1) to High impact (4)
                                                                                  31


Summary of Evaluation

 Advanced 2D/3D hardware accelerated features:



                                                   Priority of   Rank      Rank
                  Qt 4.7         wxWidgets 2.9.1
                                                    Criteria     (Qt)   (wxWidgets)


 Basic 3D
 support
                   Yes                Yes              4          5         5


Advanced           Yes
3D support
                                       No              1          3         1
             Compiling Shaders

    2D
 hardware          Yes                 No              2          5         1
 rendering
                                                                                        32


Summary of Evaluation

                                                         Priority of   Rank      Rank
                     Qt 4.7       wxWidgets 2.9.1
                                                          Criteria     (Qt)   (wxWidgets)


Portability and
Compatibility
                      Yes                Yes                 4          5         5

                                          No
 Compilers            Yes
 Integration
                                    Only libs and            4          5         4
                  VC++, Eclipse
                                  making project files

                                         Yes
GUI designer          Yes                                    4          5         4
                                      Third-party

                    Excellent         Excellent
                  Official book      Official book
 Documents                                                   3          5         5
                    Samples            Samples
                     Forum         Forum / wxWiki
                                                                                          33


Summary of Evaluation
                                                           Priority of   Rank      Rank
                       Qt 4.7          wxWidgets 2.9.1
                                                            Criteria     (Qt)   (wxWidgets)


Maintainability
development           Excellent              Good              3          5         4
   stability

                     Less codes           More codes
 Ease of use                                                   1          5         4
                    Less complex         A bit complex

                         Yes           Yes (Third-party)

  Support               Email             TT-solutions
(Commercial)                                                   2          5         3
                  Customer Portal      Email/phone/Skype
                  2,000$ - 5,000$/yr       100€/hour

                        LGPL                 LGPL
   License
                        GPL                   and
   Pricing                                                     4          5         5
                     Commercial        User's own terms
 (12 months)
                  2,300$ – 3,700$           (binary)
                                                                                        34


Summary of Evaluation
 Additional framework features:


                                                         Priority of   Rank      Rank
                      Qt 4.7         wxWidgets 2.9.1
                                                          Criteria     (Qt)   (wxWidgets)



    XML                Yes                 Yes               3          5         5


 Multimedia            Yes                 Yes               1          4         4


Multithreading         Yes                 Yes               1          5         5

                 New keywords              Yes
Standard C++          added          Uses Macros a lot       1          3         4
                 e.g. Public slot:    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.

                                              Qt       wxWidgets


       5



       4



       3

Rank

       2



       1



       0
           1   2   3     4    5   6   7   8        9       10    11   12   13   14   15   16   17   18   19
                                                       Criterion
                                                                 36


Major Users and Applications

 wxWidgets :                       Qt :

 3D games / apps:                  3D games / apps:
                                       1.   Autodesk Maya 2011
  1.    Unreal Game Engine 3
        (Price: +1 million USD)       2.   Autodesk Mudbox3D

                                       3.   Nextlimit RealFlow
  2.    Shark 3D for games
                                       4.   Google Earth


 Other apps:
   Code::Blocks
                                       Other apps:
   FileZilla
                                       1.   VLC player
   AOL Communicator
                                       2.   Skype
   AMD, Advanced Micro Devices
            37




Thank you

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:1
posted:5/8/2013
language:
pages:37