src/core/winrt/SDL_winrtapp_direct3d.cpp
changeset 8531 d481485a1b85
parent 8522 3ae9dc9c439f
child 8542 97dcef41e4a7
     1.1 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp	Mon Sep 16 22:43:12 2013 -0400
     1.2 +++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp	Sun Sep 22 12:26:53 2013 -0400
     1.3 @@ -38,6 +38,7 @@
     1.4  
     1.5  #include "../../video/winrt/SDL_winrtevents_c.h"
     1.6  #include "../../video/winrt/SDL_winrtvideo_cpp.h"
     1.7 +#include "SDL_winrtapp_common.h"
     1.8  #include "SDL_winrtapp_direct3d.h"
     1.9  
    1.10  
    1.11 @@ -48,12 +49,6 @@
    1.12  //#define LOG_ORIENTATION_EVENTS 1
    1.13  
    1.14  
    1.15 -// HACK, DLudwig: The C-style main() will get loaded via the app's
    1.16 -// WinRT-styled main(), which is part of SDLmain_for_WinRT.cpp.
    1.17 -// This seems wrong on some level, but does seem to work.
    1.18 -typedef int (*SDL_WinRT_MainFunction)(int, char **);
    1.19 -static SDL_WinRT_MainFunction SDL_WinRT_main = nullptr;
    1.20 -
    1.21  // HACK, DLudwig: record a reference to the global, WinRT 'app'/view.
    1.22  // SDL/WinRT will use this throughout its code.
    1.23  //
    1.24 @@ -83,9 +78,9 @@
    1.25      return app;
    1.26  }
    1.27  
    1.28 -__declspec(dllexport) int SDL_WinRT_RunApplication(SDL_WinRT_MainFunction mainFunction)
    1.29 +int SDL_WinRTInitNonXAMLApp(int (*mainFunction)(int, char **))
    1.30  {
    1.31 -    SDL_WinRT_main = mainFunction;
    1.32 +    WINRT_SDLAppEntryPoint = mainFunction;
    1.33      auto direct3DApplicationSource = ref new SDLApplicationSource();
    1.34      CoreApplication::Run(direct3DApplicationSource);
    1.35      return 0;
    1.36 @@ -328,13 +323,13 @@
    1.37  void SDL_WinRTApp::Run()
    1.38  {
    1.39      SDL_SetMainReady();
    1.40 -    if (SDL_WinRT_main)
    1.41 +    if (WINRT_SDLAppEntryPoint)
    1.42      {
    1.43          // TODO, WinRT: pass the C-style main() a reasonably realistic
    1.44          // representation of command line arguments.
    1.45          int argc = 0;
    1.46          char **argv = NULL;
    1.47 -        SDL_WinRT_main(argc, argv);
    1.48 +        WINRT_SDLAppEntryPoint(argc, argv);
    1.49      }
    1.50  }
    1.51