Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7423


Ignore:
Timestamp:
Sep 12, 2010, 1:39:02 PM (14 years ago)
Author:
rgrieder
Message:

Sorted out application entry point.

Location:
sandbox_qt/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sandbox_qt/src/CMakeLists.txt

    r7421 r7423  
    9494  ${ORXONOX_WIN32}
    9595  LINK_LIBRARIES
     96    ${QT_QTMAIN_LIBRARY}
    9697    orxonox
    9798  SOURCE_FILES
  • sandbox_qt/src/Orxonox.cc

    r6417 r7423  
    3434*/
    3535
    36 #include "SpecialConfig.h"
    37 
    38 #ifdef ORXONOX_USE_WINMAIN
    39 # ifndef WIN32_LEAN_AND_MEAN
    40 #  define WIN32_LEAN_AND_MEAN
    41 # endif
    42 #include <windows.h>
    43 #endif
     36#include "OrxonoxConfig.h"
    4437
    4538#include "util/Debug.h"
     
    5144    Main method. Game starts here (except for static initialisations).
    5245*/
    53 #ifdef ORXONOX_USE_WINMAIN
    54 INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
    55 #else
    5646int main(int argc, char** argv)
    57 #endif
    5847{
    5948    try
    6049    {
    61 #ifndef ORXONOX_USE_WINMAIN
    62         std::string strCmdLine;
    63         for (int i = 1; i < argc; ++i)
    64             strCmdLine = strCmdLine + argv[i] + ' ';
    65 #endif
    66 
    67         return orxonox::main(strCmdLine);
     50        return orxonox::main(argc, argv);
    6851    }
    6952    catch (...)
  • sandbox_qt/src/orxonox/CMakeLists.txt

    r7421 r7423  
    3333  LINK_LIBRARIES
    3434    ${QT_QTCORE_LIBRARY}
     35    ${QT_QTGUI_LIBRARY}
    3536    util
    3637    core
  • sandbox_qt/src/orxonox/Main.cc

    r7421 r7423  
    3636#include "OrxonoxPrereqs.h"
    3737
     38#include <QApplication>
     39#include <QCoreApplication>
     40
    3841#include "core/Game.h"
    3942#include "Main.h"
     
    4548        Starting point of orxonox (however not the entry point of the program!)
    4649    */
    47     int main(const std::string& strCmdLine)
     50    int main(int argc, char** argv)
    4851    {
    49         Game* game = new Game(strCmdLine);
     52        QApplication app(argc, argv);
     53
     54        QCoreApplication::setOrganizationName("");
     55        QCoreApplication::setOrganizationDomain("");
     56        QCoreApplication::setApplicationName("");
    5057
    5158        //if (CommandLineParser::getValue("generateDoc").getString().empty())
    52         //    game->run();
    5359
    54         delete game;
    55 
    56         return 0;
     60        return app.exec();
     61        //return 0;
    5762    }
    5863}
  • sandbox_qt/src/orxonox/Main.h

    r5693 r7423  
    3535namespace orxonox
    3636{
    37     _OrxonoxExport int main(const std::string& strCmdLine);
     37    _OrxonoxExport int main(int argc, char** argv);
    3838}
    3939
Note: See TracChangeset for help on using the changeset viewer.