src/video/windowsrt/SDL_WinRTApp.h
author David Ludwig <dludwig@pobox.com>
Sun, 28 Oct 2012 20:47:33 -0400
changeset 8332 ea83d191cc17
parent 8331 737dc8a4f49f
child 8333 49973bfb8d23
permissions -rw-r--r--
WinRT: added mouse button event support
     1 #pragma once
     2 
     3 #include "SDLmain_WinRT_common.h"
     4 #include "CubeRenderer.h"
     5 #include <vector>
     6 
     7 using namespace Windows::UI::Core;
     8 
     9 ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
    10 {
    11 public:
    12 	SDL_WinRTApp();
    13 	
    14 	// IFrameworkView Methods.
    15 	virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
    16 	virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
    17 	virtual void Load(Platform::String^ entryPoint);
    18 	virtual void Run();
    19 	virtual void Uninitialize();
    20 
    21 internal:
    22     // SDL-specific methods
    23     SDL_DisplayMode GetMainDisplayMode();
    24     void PumpEvents();
    25 
    26 protected:
    27 	// Event Handlers.
    28 	void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
    29 	void OnLogicalDpiChanged(Platform::Object^ sender);
    30 	void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
    31 	void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
    32 	void OnResuming(Platform::Object^ sender, Platform::Object^ args);
    33 	void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
    34 	void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
    35 	void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    36 	void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    37 	void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
    38 
    39 private:
    40 	CubeRenderer^ m_renderer;
    41 	bool m_windowClosed;
    42 	bool m_windowVisible;
    43 };
    44 
    45 ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
    46 {
    47 public:
    48 	virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
    49 };