src/video/windowsrt/SDL_WinRTApp.h
author David Ludwig <dludwig@pobox.com>
Tue, 08 Jan 2013 23:11:22 -0500
changeset 8384 bc7a52629e1e
parent 8378 357a8e1166e5
child 8400 1315402d9028
permissions -rw-r--r--
WinRT: converted tabs to spaces in src/video/windowsrt/*
     1 #pragma once
     2 
     3 #include "SDLmain_WinRT_common.h"
     4 #include "SDL_winrtvideo.h"
     5 #include "SDL_winrtrenderer.h"
     6 #include <vector>
     7 
     8 using namespace Windows::UI::Core;
     9 
    10 ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
    11 {
    12 public:
    13     SDL_WinRTApp();
    14     
    15     // IFrameworkView Methods.
    16     virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
    17     virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
    18     virtual void Load(Platform::String^ entryPoint);
    19     virtual void Run();
    20     virtual void Uninitialize();
    21 
    22 internal:
    23     // SDL-specific methods
    24     SDL_DisplayMode GetMainDisplayMode();
    25     void PumpEvents();
    26     const SDL_WindowData * GetSDLWindowData() const;
    27     bool HasSDLWindowData() const;
    28     void SetRelativeMouseMode(bool enable);
    29     void SetSDLWindowData(const SDL_WindowData * windowData);
    30     void UpdateWindowFramebuffer(SDL_Surface * surface, SDL_Rect * rects, int numrects);
    31     void ResizeMainTexture(int w, int h);
    32     Windows::Foundation::Point TransformCursor(Windows::Foundation::Point rawPosition);
    33 
    34 protected:
    35     // Event Handlers.
    36     void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
    37     void OnLogicalDpiChanged(Platform::Object^ sender);
    38     void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
    39     void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
    40     void OnResuming(Platform::Object^ sender, Platform::Object^ 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);
    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);
    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);
    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);
    49 
    50 private:
    51     SDL_winrtrenderer^ m_renderer;
    52     bool m_windowClosed;
    53     bool m_windowVisible;
    54     const SDL_WindowData* m_sdlWindowData;
    55     bool m_useRelativeMouseMode;
    56 };
    57 
    58 ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
    59 {
    60 public:
    61     virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
    62 };