WinRT: emit SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events
authorDavid Ludwig <dludwig@pobox.com>
Tue, 04 Mar 2014 19:30:36 -0500
changeset 85802754762c0860
parent 8579 ee7126c459d0
child 8581 c001dc3e258b
WinRT: emit SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events
src/core/winrt/SDL_winrtapp_direct3d.cpp
     1.1 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp	Sat Mar 01 16:37:30 2014 -0500
     1.2 +++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp	Tue Mar 04 19:30:36 2014 -0500
     1.3 @@ -35,6 +35,7 @@
     1.4  #include "SDL_render.h"
     1.5  #include "../../video/SDL_sysvideo.h"
     1.6  //#include "../../SDL_hints_c.h"
     1.7 +#include "../../events/SDL_events_c.h"
     1.8  #include "../../events/SDL_keyboard_c.h"
     1.9  #include "../../events/SDL_mouse_c.h"
    1.10  #include "../../events/SDL_windowevents_c.h"
    1.11 @@ -547,12 +548,19 @@
    1.12              SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_MINIMIZED, 0, 0);   // TODO: see if SDL_WINDOWEVENT_SIZE_CHANGED should be getting triggered here (it is, currently)
    1.13              SDL_FilterEvents(RemoveAppSuspendAndResumeEvents, 0);
    1.14          }
    1.15 +
    1.16 +        SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND);
    1.17 +        SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND);
    1.18 +
    1.19          deferral->Complete();
    1.20      });
    1.21  }
    1.22  
    1.23  void SDL_WinRTApp::OnResuming(Platform::Object^ sender, Platform::Object^ args)
    1.24  {
    1.25 +    SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
    1.26 +    SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
    1.27 +
    1.28      // Restore any data or state that was unloaded on suspend. By default, data
    1.29      // and state are persisted when resuming from suspend. Note that this event
    1.30      // does not occur if the app was previously terminated.