WinRT: minor cleanup in top-level app code
authorDavid Ludwig <dludwig@pobox.com>
Fri, 22 Feb 2013 23:44:34 -0500
changeset 84366d2329b6f7c7
parent 8435 2d3fe6870df3
child 8437 d6a6c3ebdf3e
WinRT: minor cleanup in top-level app code
src/video/windowsrt/SDL_WinRTApp.cpp
     1.1 --- a/src/video/windowsrt/SDL_WinRTApp.cpp	Fri Feb 22 23:23:53 2013 -0500
     1.2 +++ b/src/video/windowsrt/SDL_WinRTApp.cpp	Fri Feb 22 23:44:34 2013 -0500
     1.3 @@ -22,10 +22,17 @@
     1.4  #include <unordered_map>
     1.5  #include <sstream>
     1.6  
     1.7 +using namespace concurrency;
     1.8 +using namespace std;
     1.9 +using namespace Windows::ApplicationModel;
    1.10 +using namespace Windows::ApplicationModel::Core;
    1.11 +using namespace Windows::ApplicationModel::Activation;
    1.12 +using namespace Windows::Devices::Input;
    1.13  using namespace Windows::Graphics::Display;
    1.14 -
    1.15 -// TODO, WinRT: Remove reference(s) to BasicTimer.h
    1.16 -//#include "BasicTimer.h"
    1.17 +using namespace Windows::Foundation;
    1.18 +using namespace Windows::System;
    1.19 +using namespace Windows::UI::Core;
    1.20 +using namespace Windows::UI::Input;
    1.21  
    1.22  // HACK, DLudwig: The C-style main() will get loaded via the app's
    1.23  // WinRT-styled main(), which is part of SDLmain_for_WinRT.cpp.
    1.24 @@ -33,6 +40,15 @@
    1.25  typedef int (*SDL_WinRT_MainFunction)(int, char **);
    1.26  static SDL_WinRT_MainFunction SDL_WinRT_main = nullptr;
    1.27  
    1.28 +// HACK, DLudwig: record a reference to the global, Windows RT 'app'/view.
    1.29 +// SDL/WinRT will use this throughout its code.
    1.30 +//
    1.31 +// TODO, WinRT: consider replacing SDL_WinRTGlobalApp with something
    1.32 +// non-global, such as something created inside
    1.33 +// SDL_InitSubSystem(SDL_INIT_VIDEO), or something inside
    1.34 +// SDL_CreateWindow().
    1.35 +SDL_WinRTApp ^ SDL_WinRTGlobalApp = nullptr;
    1.36 +
    1.37  static void WINRT_SetDisplayOrientationsPreference(const char *name, const char *oldValue, const char *newValue)
    1.38  {
    1.39      SDL_assert(SDL_strcmp(name, SDL_HINT_ORIENTATIONS) == 0);
    1.40 @@ -82,27 +98,6 @@
    1.41      DisplayProperties::AutoRotationPreferences = (DisplayOrientations) orientationFlags;
    1.42  }
    1.43  
    1.44 -// HACK, DLudwig: record a reference to the global, Windows RT 'app'/view.
    1.45 -// SDL/WinRT will use this throughout its code.
    1.46 -//
    1.47 -// TODO, WinRT: consider replacing SDL_WinRTGlobalApp with something
    1.48 -// non-global, such as something created inside
    1.49 -// SDL_InitSubSystem(SDL_INIT_VIDEO), or something inside
    1.50 -// SDL_CreateWindow().
    1.51 -SDL_WinRTApp ^ SDL_WinRTGlobalApp = nullptr;
    1.52 -
    1.53 -using namespace std;
    1.54 -using namespace Windows::ApplicationModel;
    1.55 -using namespace Windows::ApplicationModel::Core;
    1.56 -using namespace Windows::ApplicationModel::Activation;
    1.57 -using namespace Windows::Devices::Input;
    1.58 -using namespace Windows::UI::Core;
    1.59 -using namespace Windows::UI::Input;
    1.60 -using namespace Windows::System;
    1.61 -using namespace Windows::Foundation;
    1.62 -using namespace Windows::Graphics::Display;
    1.63 -using namespace concurrency;
    1.64 -
    1.65  SDL_WinRTApp::SDL_WinRTApp() :
    1.66      m_windowClosed(false),
    1.67      m_windowVisible(true),
    1.68 @@ -170,8 +165,6 @@
    1.69  
    1.70      window->KeyUp +=
    1.71          ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &SDL_WinRTApp::OnKeyUp);
    1.72 -
    1.73 -    //m_renderer->Initialize(CoreWindow::GetForCurrentThread());    // DLudwig: moved this call to WINRT_CreateWindow, likely elsewhere in the future
    1.74  }
    1.75  
    1.76  void SDL_WinRTApp::Load(Platform::String^ entryPoint)