1
0

SDL_winrtapp_direct3d.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #include <Windows.h>
  19. extern int SDL_WinRTInitNonXAMLApp(int (*mainFunction)(int, char **));
  20. ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
  21. {
  22. public:
  23. SDL_WinRTApp();
  24. // IFrameworkView Methods.
  25. virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
  26. virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
  27. virtual void Load(Platform::String^ entryPoint);
  28. virtual void Run();
  29. virtual void Uninitialize();
  30. internal:
  31. // SDL-specific methods
  32. void PumpEvents();
  33. protected:
  34. // Event Handlers.
  35. #if WINAPI_FAMILY == WINAPI_FAMILY_APP // for Windows 8/8.1/RT apps... (and not Phone apps)
  36. void OnSettingsPaneCommandsRequested(
  37. Windows::UI::ApplicationSettings::SettingsPane ^p,
  38. Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^args);
  39. #endif // if WINAPI_FAMILY == WINAPI_FAMILY_APP
  40. #if NTDDI_VERSION > NTDDI_WIN8
  41. void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
  42. #else
  43. void OnOrientationChanged(Platform::Object^ sender);
  44. #endif
  45. void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
  46. void OnLogicalDpiChanged(Platform::Object^ sender);
  47. void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
  48. void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
  49. void OnResuming(Platform::Object^ sender, Platform::Object^ args);
  50. void OnExiting(Platform::Object^ sender, Platform::Object^ args);
  51. void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
  52. void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
  53. void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
  54. void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
  55. void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
  56. void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
  57. void OnMouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args);
  58. void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
  59. void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
  60. #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
  61. void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args);
  62. #endif
  63. private:
  64. bool m_windowClosed;
  65. bool m_windowVisible;
  66. };
  67. extern SDL_WinRTApp ^ SDL_WinRTGlobalApp;