BsEditorExec.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include <iostream>
  4. #include <stdio.h>
  5. #include "BsEditorApplication.h"
  6. #include "Error/BsCrashHandler.h"
  7. #include "BsEditorScriptLibrary.h"
  8. #if BS_PLATFORM == BS_PLATFORM_WIN32
  9. #include <windows.h>
  10. using namespace bs;
  11. int CALLBACK WinMain(
  12. _In_ HINSTANCE hInstance,
  13. _In_ HINSTANCE hPrevInstance,
  14. _In_ LPSTR lpCmdLine,
  15. _In_ int nCmdShow
  16. )
  17. {
  18. CrashHandler::startUp();
  19. __try
  20. {
  21. SPtr<EditorScriptLibrary> library = bs_shared_ptr_new<EditorScriptLibrary>();
  22. ScriptManager::_setScriptLibrary(library);
  23. EditorApplication::startUp();
  24. EditorApplication::instance().runMainLoop();
  25. EditorApplication::shutDown();
  26. }
  27. __except (gCrashHandler().reportCrash(GetExceptionInformation()))
  28. {
  29. PlatformUtility::terminate(true);
  30. }
  31. CrashHandler::shutDown();
  32. return 0;
  33. }
  34. #else
  35. using namespace bs;
  36. int main()
  37. {
  38. SPtr<EditorScriptLibrary> library = bs_shared_ptr_new<EditorScriptLibrary>();
  39. ScriptManager::_setScriptLibrary(library);
  40. EditorApplication::startUp();
  41. EditorApplication::instance().runMainLoop();
  42. EditorApplication::shutDown();
  43. }
  44. #endif // End BS_PLATFORM