This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
SDL_WinRTApp.h
52 lines (46 loc) · 2.68 KB
1
2
#pragma once
3
struct SDL_WindowData;
4
5
6
7
ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
{
public:
8
9
10
11
12
13
14
15
SDL_WinRTApp();
// IFrameworkView Methods.
virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
virtual void Load(Platform::String^ entryPoint);
virtual void Run();
virtual void Uninitialize();
16
17
18
19
internal:
// SDL-specific methods
SDL_DisplayMode GetMainDisplayMode();
20
void PumpEvents();
21
const SDL_WindowData * GetSDLWindowData() const;
22
bool HasSDLWindowData() const;
23
void SetRelativeMouseMode(bool enable);
24
void SetSDLWindowData(const SDL_WindowData * windowData);
25
void SetSDLVideoDevice(const SDL_VideoDevice * videoDevice);
26
Windows::Foundation::Point TransformCursor(Windows::Foundation::Point rawPosition);
27
28
protected:
29
// Event Handlers.
30
void OnOrientationChanged(Platform::Object^ sender);
31
32
33
34
35
36
37
38
39
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
void OnLogicalDpiChanged(Platform::Object^ sender);
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
40
void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
41
void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
42
void OnMouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args);
43
44
void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
45
46
private:
47
48
bool m_windowClosed;
bool m_windowVisible;
49
const SDL_WindowData* m_sdlWindowData;
50
const SDL_VideoDevice* m_sdlVideoDevice;
51
bool m_useRelativeMouseMode;
52
};