Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
WinRT: minor cleanup in top-level app code
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Feb 23, 2013
1 parent 1ea6e06 commit 8971883
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions src/video/windowsrt/SDL_WinRTApp.cpp
Expand Up @@ -22,17 +22,33 @@ extern "C" {
#include <unordered_map>
#include <sstream>

using namespace concurrency;
using namespace std;
using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::Devices::Input;
using namespace Windows::Graphics::Display;

// TODO, WinRT: Remove reference(s) to BasicTimer.h
//#include "BasicTimer.h"
using namespace Windows::Foundation;
using namespace Windows::System;
using namespace Windows::UI::Core;
using namespace Windows::UI::Input;

// HACK, DLudwig: The C-style main() will get loaded via the app's
// WinRT-styled main(), which is part of SDLmain_for_WinRT.cpp.
// This seems wrong on some level, but does seem to work.
typedef int (*SDL_WinRT_MainFunction)(int, char **);
static SDL_WinRT_MainFunction SDL_WinRT_main = nullptr;

// HACK, DLudwig: record a reference to the global, Windows RT 'app'/view.
// SDL/WinRT will use this throughout its code.
//
// TODO, WinRT: consider replacing SDL_WinRTGlobalApp with something
// non-global, such as something created inside
// SDL_InitSubSystem(SDL_INIT_VIDEO), or something inside
// SDL_CreateWindow().
SDL_WinRTApp ^ SDL_WinRTGlobalApp = nullptr;

static void WINRT_SetDisplayOrientationsPreference(const char *name, const char *oldValue, const char *newValue)
{
SDL_assert(SDL_strcmp(name, SDL_HINT_ORIENTATIONS) == 0);
Expand Down Expand Up @@ -82,27 +98,6 @@ static void WINRT_SetDisplayOrientationsPreference(const char *name, const char
DisplayProperties::AutoRotationPreferences = (DisplayOrientations) orientationFlags;
}

// HACK, DLudwig: record a reference to the global, Windows RT 'app'/view.
// SDL/WinRT will use this throughout its code.
//
// TODO, WinRT: consider replacing SDL_WinRTGlobalApp with something
// non-global, such as something created inside
// SDL_InitSubSystem(SDL_INIT_VIDEO), or something inside
// SDL_CreateWindow().
SDL_WinRTApp ^ SDL_WinRTGlobalApp = nullptr;

using namespace std;
using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::Devices::Input;
using namespace Windows::UI::Core;
using namespace Windows::UI::Input;
using namespace Windows::System;
using namespace Windows::Foundation;
using namespace Windows::Graphics::Display;
using namespace concurrency;

SDL_WinRTApp::SDL_WinRTApp() :
m_windowClosed(false),
m_windowVisible(true),
Expand Down Expand Up @@ -170,8 +165,6 @@ void SDL_WinRTApp::SetWindow(CoreWindow^ window)

window->KeyUp +=
ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &SDL_WinRTApp::OnKeyUp);

//m_renderer->Initialize(CoreWindow::GetForCurrentThread()); // DLudwig: moved this call to WINRT_CreateWindow, likely elsewhere in the future
}

void SDL_WinRTApp::Load(Platform::String^ entryPoint)
Expand Down

0 comments on commit 8971883

Please sign in to comment.