main_gui.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "utilities/GUIApplicationManager.h"
  9. #include <AzQtComponents/Utilities/HandleDpiAwareness.h>
  10. int main(int argc, char* argv[])
  11. {
  12. const AZ::Debug::Trace tracer;
  13. qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "1");
  14. AzQtComponents::Utilities::HandleDpiAwareness(AzQtComponents::Utilities::PerScreenDpiAware);
  15. GUIApplicationManager applicationManager(&argc, &argv);
  16. ApplicationManager::BeforeRunStatus status = applicationManager.BeforeRun();
  17. if (status != ApplicationManager::BeforeRunStatus::Status_Success)
  18. {
  19. if (status == ApplicationManager::BeforeRunStatus::Status_Restarting)
  20. {
  21. //AssetProcessor will restart
  22. return 0;
  23. }
  24. else
  25. {
  26. //Initialization failed
  27. return 1;
  28. }
  29. }
  30. return applicationManager.Run() ? 0 : 1;
  31. }