Skip to content

Commit

Permalink
WinRT: emit SDL_APP_TERMINATING
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Mar 5, 2014
1 parent 844ad50 commit 61ae0c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/winrt/SDL_winrtapp_direct3d.cpp
Expand Up @@ -259,6 +259,9 @@ void SDL_WinRTApp::Initialize(CoreApplicationView^ applicationView)
CoreApplication::Resuming +=
ref new EventHandler<Platform::Object^>(this, &SDL_WinRTApp::OnResuming);

CoreApplication::Exiting +=
ref new EventHandler<Platform::Object^>(this, &SDL_WinRTApp::OnExiting);

DisplayProperties::OrientationChanged +=
ref new DisplayPropertiesEventHandler(this, &SDL_WinRTApp::OnOrientationChanged);

Expand Down Expand Up @@ -578,6 +581,11 @@ void SDL_WinRTApp::OnResuming(Platform::Object^ sender, Platform::Object^ args)
}
}

void SDL_WinRTApp::OnExiting(Platform::Object^ sender, Platform::Object^ args)
{
SDL_SendAppEvent(SDL_APP_TERMINATING);
}

static void
WINRT_LogPointerEvent(const char * header, Windows::UI::Core::PointerEventArgs ^ args, Windows::Foundation::Point transformedPoint)
{
Expand Down
1 change: 1 addition & 0 deletions src/core/winrt/SDL_winrtapp_direct3d.h
Expand Up @@ -35,6 +35,7 @@ ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFramewo
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
void OnExiting(Platform::Object^ sender, Platform::Object^ args);
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
Expand Down

0 comments on commit 61ae0c1

Please sign in to comment.