mainStuff.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * This file is part of XDRE.
  3. *
  4. * XDRE is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * XDRE is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with XDRE. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. *
  18. * Description: XDRE main() stuff. Copied and pasted from main.cpp and GuiWx.*.
  19. */
  20. //for mingw-w64
  21. #include "SDL.h"
  22. #include "xdre.hpp"
  23. #include <wx/app.h>
  24. #include "MainWindow.hpp"
  25. class MainWindow;
  26. class GuiWx : public wxApp {
  27. public:
  28. virtual bool OnInit();
  29. protected:
  30. private:
  31. MainWindow* mainWindow;
  32. };
  33. bool GuiWx::OnInit() {
  34. mainWindow = new MainWindow();
  35. mainWindow->Show(true);
  36. return true;
  37. }
  38. int main(int argc, char** argv) {
  39. GuiWx* gui = new GuiWx();
  40. wxApp::SetInstance(gui);
  41. //this is really important, I have had no idea about that problem
  42. xdre::init(argc, argv);
  43. return wxEntry(argc, argv);
  44. }