SDLPal.cpp 727 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "pch.h"
  2. #include <wrl.h>
  3. #include <windows.h>
  4. #include "../SDLPal.Common/AsyncHelper.h"
  5. #include "../../global.h"
  6. #include "App.xaml.h"
  7. HANDLE g_eventHandle;
  8. int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
  9. {
  10. if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) {
  11. return 1;
  12. }
  13. g_eventHandle = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS);
  14. PAL_LoadConfig(TRUE);
  15. if (gConfig.fLaunchSetting)
  16. {
  17. Windows::UI::Xaml::Application::Start(
  18. ref new Windows::UI::Xaml::ApplicationInitializationCallback(
  19. [](Windows::UI::Xaml::ApplicationInitializationCallbackParams^ p) {
  20. auto app = ref new SDLPal::App();
  21. }
  22. )
  23. );
  24. }
  25. else
  26. SDL_WinRTRunApp(SDL_main, NULL);
  27. return 0;
  28. }