src/video/windowsrt/SDL_WinRTApp.h
changeset 8384 bc7a52629e1e
parent 8378 357a8e1166e5
child 8400 1315402d9028
equal deleted inserted replaced
8383:1f415392ccf0 8384:bc7a52629e1e
     8 using namespace Windows::UI::Core;
     8 using namespace Windows::UI::Core;
     9 
     9 
    10 ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
    10 ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
    11 {
    11 {
    12 public:
    12 public:
    13 	SDL_WinRTApp();
    13     SDL_WinRTApp();
    14 	
    14     
    15 	// IFrameworkView Methods.
    15     // IFrameworkView Methods.
    16 	virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
    16     virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
    17 	virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
    17     virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
    18 	virtual void Load(Platform::String^ entryPoint);
    18     virtual void Load(Platform::String^ entryPoint);
    19 	virtual void Run();
    19     virtual void Run();
    20 	virtual void Uninitialize();
    20     virtual void Uninitialize();
    21 
    21 
    22 internal:
    22 internal:
    23     // SDL-specific methods
    23     // SDL-specific methods
    24     SDL_DisplayMode GetMainDisplayMode();
    24     SDL_DisplayMode GetMainDisplayMode();
    25     void PumpEvents();
    25     void PumpEvents();
    30     void UpdateWindowFramebuffer(SDL_Surface * surface, SDL_Rect * rects, int numrects);
    30     void UpdateWindowFramebuffer(SDL_Surface * surface, SDL_Rect * rects, int numrects);
    31     void ResizeMainTexture(int w, int h);
    31     void ResizeMainTexture(int w, int h);
    32     Windows::Foundation::Point TransformCursor(Windows::Foundation::Point rawPosition);
    32     Windows::Foundation::Point TransformCursor(Windows::Foundation::Point rawPosition);
    33 
    33 
    34 protected:
    34 protected:
    35 	// Event Handlers.
    35     // Event Handlers.
    36 	void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
    36     void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
    37 	void OnLogicalDpiChanged(Platform::Object^ sender);
    37     void OnLogicalDpiChanged(Platform::Object^ sender);
    38 	void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
    38     void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
    39 	void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
    39     void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
    40 	void OnResuming(Platform::Object^ sender, Platform::Object^ args);
    40     void OnResuming(Platform::Object^ sender, Platform::Object^ args);
    41 	void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
    41     void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
    42 	void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
    42     void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
    43 	void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    43     void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    44 	void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    44     void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    45 	void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    45     void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    46     void OnMouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args);
    46     void OnMouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args);
    47     void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
    47     void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
    48     void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
    48     void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
    49 
    49 
    50 private:
    50 private:
    51 	SDL_winrtrenderer^ m_renderer;
    51     SDL_winrtrenderer^ m_renderer;
    52 	bool m_windowClosed;
    52     bool m_windowClosed;
    53 	bool m_windowVisible;
    53     bool m_windowVisible;
    54     const SDL_WindowData* m_sdlWindowData;
    54     const SDL_WindowData* m_sdlWindowData;
    55     bool m_useRelativeMouseMode;
    55     bool m_useRelativeMouseMode;
    56 };
    56 };
    57 
    57 
    58 ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
    58 ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
    59 {
    59 {
    60 public:
    60 public:
    61 	virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
    61     virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
    62 };
    62 };